How to send multiple values from a single php script to c# client -
i had php script returns value c# client.
<?php //catching data client $name=strtoupper(strip_tags($_post['name'])); if($name)//checking if data not empty { ($connect=mysql_connect("localhost","root","")) or die("host connection failed");//unsuccessful registration (mysql_select_db("hello")) or die("database selection failed");//unsuccessful registration //inserting values $query=mysql_query("insert users values('','$name')"); //getting id of last inserted row $id=mysql_insert_id(); if($id) die("$id");//successful registration. else die("registration failed");//unsuccessful registration } else die("incomplete details");//unsuccessful registration ?>
the above script works fine , $id returned c# client can used @ client end further code @ client's side.
but problem if have return more 1 values , use them @ client's side further code. instance, have return id, location , age c# client, how can accomplish this?
i mean if echo out 3 values have return, data passed mere string. how going differentiated? , if want send integer 0 or 1 can switch corresponding module @ c# client. can php return values similar in type of c# int, float etc. if have send whole object.
in short, can post more 1 values c# application php script via get/post method. how can accomplish same thing in reverse direction?
please make me aware wherever wrong. beginner php.
need help. trillion! :)
you return array rather string. array hold information needed.
$data = array( 'id' => $id, 'location' => $location, // etc );
also remember move on mysqli
mysql
deprecated , removed.
you dont need brackets around these lines:
($connect=mysql_connect("localhost","root",""))
and
(mysql_select_db("hello"))
Comments
Post a Comment