Click here to Skip to main content
15,896,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have wamp with php nd mysql installed. My php file is in PC wamp/www/Demo folder in which I written query for inserting values getting by url.
Now I want to send multiple rows of data collected from android application to MySQL Wamp server through PHP file.

My php file code is as below,

<?php

$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname="billapp";

//$id = $_GET['id'];
$order_no= $_GET['no'];
$item_name= $_GET['in'];
$item_value= $_GET['iv'];

$conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname);
if(! $conn )
{
  //die('Could not connect: ' . mysqli_error());
}
$sql1 = "INSERT INTO order_details (`order_no`,`item_name`,`item_value`) VALUES ('$order_no','$item_name','$item_value')";

$retval = mysqli_query( $conn,$sql1 );
if(! $retval )
{
  //die('Could not enter data: ');
}
echo "entered success";
mysqli_close($conn);
?>


and calling url is
"http://localhost/Demo/insertbill.php?no=10&in="item1"&iv="price1""


What I have tried:

Tried below url for single row insertion
"http://localhost/Demo/insertbill.php?no=10&in="item1"&iv="price1""

It is not possible to pass all row values like this way
what to do? please suggest.
Posted
Comments
David Crow 12-Dec-17 21:49pm    
I suspect the extra quotation marks are to blame. Do you need them? If it's a matter of retaining spaces in the item_name column, have you tried canonicalizing the URL?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900