Sharing Top Content from the Angular-sphere.

AngularJs service with PHP ~ angulardev

AngularJs service with PHP #angularjs #php #angular4 #Angular2  #javascript #2017

  • Download and include the Angularjs script from  AngularJs  .
  • include an external script ‘app.js’.


@ijasclt: AngularJs service with PHP #angularjs #php #angular4 #Angular2 #javascript #2017

AngularJs service with PHP ~ angulardev

angulardev

Technology

News Updates

Activity

About us

Contact us

Home

Business Internet

Market

Stock

Downloads Dvd

Games

Software Office

Parent Child Sub Child

Sub Child

Sub Child

Child

Child

Child

Featured

Health Childcare

Doctors

Uncategorized

Friday, 19 May 2017

Filled Under: AngularJs service with PHP

Socialize It →

Tweet

0

tbl_user.sql —— CREATE TABLE `tbl_user` ( `u_id` int(11) NOT NULL, `u_fname` text NOT NULL, `u_lname` text NOT NULL, `u_email` text NOT NULL, `u_age` tinyint(3) NOT NULL, `u_createdat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; — — Indexes for dumped tables — — — Indexes for table `tbl_user` — ALTER TABLE `tbl_user` ADD PRIMARY KEY (`u_id`); — — AUTO_INCREMENT for dumped tables — — — AUTO_INCREMENT for table `tbl_user` — ALTER TABLE `tbl_user` MODIFY `u_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=112;

app.js ——- var app=angular.module(‘app’,[]); app.service(‘dataservice’,[‘$http’,function($http){ this.save=function(data){ return $http.post(‘api/index.php’,data) .then(function(res){ return res; }) } this.getall=function(){ return $http.get(‘api?get=’+true) .then(function(res){ return res.data; console.log(res.data); }); } this.delete=function(id){ return $http.post(‘api/index.php’,{id:id}) .then(function(res){ return res; }); } this.edit=function(id){ for(var i=0;i AngularJS

To Do



  • {{d.u_fname}} – ({{d.u_age}}) delete

api/index.php ———— 0){ $res=array(); $array=array(); $count=0; while($row=mysqli_fetch_assoc($result)){ foreach($row as $key => $val){ $res[$key]=$val; } $array[]=$res; } header(‘Content-Type: application/json’); echo json_encode($array); } } } if(isset($_POST)){ $json_input = file_get_contents(‘php://input’); if($json_input){ $_REQUEST = json_decode($json_input, true); if(isset($_REQUEST[‘id’])){ $id=(int)$_REQUEST[‘id’]; var_dump($id); $sql=”DELETE FROM tbl_user WHERE u_id=$id”; mysqli_query($conn,$sql); }else{ $name=”; $age=0; if(isset($_REQUEST[‘age’])){ $age=$_REQUEST[‘age’]; } if(isset($_REQUEST[‘name’])){ $name=$_REQUEST[‘name’]; } $email=$name.”@gmail.com”; $sql=”INSERT INTO tbl_user (u_fname,u_lname,u_email,u_age) VALUES(‘$name’,’$name’,’$email’,$age)”; mysqli_query($conn,$sql); } } } } mysqli_close($conn); ?>

Older Post

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

Simple ToDo list using angularjs service

app.js —— var app=angular.module(‘app’,[]); app.service(‘dataservice’,function(){ var id=1; var sourc=[{ id:0, …

AngularJS for Absolute Beginners

Download and include the Angularjs script from  AngularJs  . include an external script ‘app.js’. app.js var app=angular.module…

AngularJs service with PHP

tbl_user.sql —— CREATE TABLE `tbl_user` ( `u_id` int(11) NOT NULL, `u_fname` text NOT NULL, `u_lname` text NOT NULL, `u_em…

 

2014 © Truemag

Distributed By Free Blogger Templates | Lyrics | Songs.pk | Download Ringtones | HD Wallpapers For Mobile

AngularJs service with PHP ~ angulardev

Comments are closed, but trackbacks and pingbacks are open.