Click here to Skip to main content
13,768,344 members
Rate this:
 
Please Sign up or sign in to vote.
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 11-Dec-17 20:33pm
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.181116.1 | Last Updated 12 Dec 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100