<?php
$title=$_POST["title"];
$theme=$_POST["theme"];
$con=mysql_connect($dbserver,$dbusername,$dbpassword);
if (!$con) { die('Could not connect: ' . mysql_error()); }
mysql_select_db($dbname, $con);
$query=mysql_query("SELECT * FROM setup WHERE id=".$_SESSION['id']);
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
if ($num_rows > 0)
{
while($row = mysql_fetch_array($result))
{
$_SESSION['id'] = $row['id'];
$_SESSION['title']=$title['title'];
$_SESSION['theme']=$theme['theme'];
}
{
mysql_query("UPDATE setup SET title='".$title."' , theme='".$theme."'WHERE id=".$_SESSION['id']);
header("Location:setup.php?status=1");
}
}
//else {
//header("Location:setup.php?status=2");
//}
mysql_close($con);
?>
this is my code for php setup-action and iam having problem for updating values in my sql and i cant understand the error please help :(
the error is on line 10 and 11
Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\project\admin\setup-action.php on line 10
Warning: mysql_num_rows() expects parameter 1 to be resource, null given in C:\xampp\htdocs\project\admin\setup-action.php on line 11