hello
in the attached code, how do i add another field to the query? ie, i have all the code to create the result and would like to add further values such as $dept? what is the correct way to code query? i must stress that i am using php 4.4.7 so json_encode is out. the code is working but just need to find a way to add the $dept to the query? many thanks
guido. sorry, i do not understand your answer. where have i changed the table layout? how do i now get values of $dept and $box and insert them in db? many thanks
Of course, you changed the table layout without saying.
You can’t use implode anymore. You’ll have to construct the values part of the query looping through the two arrays $dept and $box.
{
dept: ["BASW","BASW"],
box: ["BASW10455C","BASW10455D"]
}
test
i think test must be reffering to my connection code:
function runSQL($rsql) {
$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "sample";
$connect = mysql_connect($hostname,$username,$password) or die ("Error: could not connect to database");
$db = mysql_select_db($dbname);
$result = mysql_query($rsql) or die ('test');
return $result;
mysql_close($connect);
}
funny thing is that it works with the original code i posted just not with the addition. also, in firebug i got a json tab in the console when the query finishes but not now. thanks