fsl4faisal Posted October 10, 2010 Share Posted October 10, 2010 i need to store a variable from database like if i have "copies" in one of my column in my database then i have to store a particular value for copies store it to $copies here i want that i can store value of copies into $copies $update_book="update book set copies=copies-1 where bookid='$bookid'"; $result=mysql_query($update_book,$linkID1); if($result) { print "<html><body background=\"header.jpg\"> <p>book successfully subtracted from database</p></body></html>"; } else { print "<html><body background=\"header.jpg\"> <p>problem occured</p></body></html>"; } } Quote Link to comment Share on other sites More sharing options...
chintansshah Posted October 10, 2010 Share Posted October 10, 2010 after an update query, use select query list($copies)= mysql_fetchrow(mysql_query("select copies FROM book where bookid='$bookid'")); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.