While updating i want to select the value of route from the another table when i try to do this it showing Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
This is my code:
<?php
$dbHost = 'localhost'; // usually localhost
$dbUsername = 'xxxxxxx';
$dbPassword = 'xxxxxxxxxx';
$dbDatabase = 'fms';
$db = mysql_connect($dbHost, $dbUsername, $dbPassword) or die ("Unable to connect to Database Server.");
mysql_select_db ($dbDatabase, $db) or die ("Could not select database.");
$client_id=$_POST['clientid'];
$feild=$_POST['field'];
$data= $_POST['value'];
$rownum=$_POST['rowid'];
$sql="UPDATE $client_id SET ".$feild." = '".$data."' WHERE net_id = ".$rownum."";
print $sql;
mysql_query($sql);
//Select route from client Table
$sql_select="select route from $client_id WHERE net_id = ".$rownum."";
mysql_query($sql_select);
print $sql_select;
print mysql_error();
$i=1;
while($rows=mysql_fetch_assoc($sql_select))
{
$route=$rows['route'];
}
?>
Please help me, thank in advance