Sunday, December 4, 2011

Why my php/mysql code is not working (5 stars)?

here the code








%26lt;?php





session_start();


include "connect.php";








$share = protect($_POST['share']);


//var_dump($share);








$sql="SELECT * FROM table WHERE id ='$_SESSION['id']'";


$result=mysql_query($sql) or die(mysql_error());


$count=mysql_num_rows($result);





while($row = mysql_fetch_assoc($result)){








mysql_query((UPDATE `my_db`.`m_user_acc` SET `status` = '$share' WHERE `table`.`uid` =$_SESSION['id']);





}








?%26gt;





i checked it , it is working upto var_dump





and i also wnt it to redirect it to another page(lets say index.php)





thanx|||Try this:


If it doesn't work, I'll be back after school to help.





%26lt;?php


session_start();


include("connect.php");





$share = protect($_POST['share']);


//var_dump($share);





$session = "".$_SESSION['id']."";





$sql = mysql_query("SELECT * FROM table WHERE id ='$session'");


$count = mysql_num_rows($sql);





while($row = mysql_fetch_assoc($result)){


mysql_query("UPDATE `my_db`.`m_user_acc` SET `status` = '$share' WHERE `table`.`uid` = $session");


}


?%26gt;

No comments:

Post a Comment