problem with syntax
Posted: Mon Jun 25, 2007 9:27 am
feyd | Please use
I am using mysql and my datatype for the placesavailable field is integer (11)
Many thanks in anticipation
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
i have a database which is taking bookings for courses. when i abooking has been made i am trying to get the places available field to decrease by 1. when it does this it goes from 15 to 0. please can anyone shed any light on this. my code etc is belowCode: Select all
$sql = "SELECT * FROM rsu WHERE CourseID LIKE '$courseid'";
$resultID1 = mysql_query($sql, $linkID)or die(mysql_error());
if(mysql_num_rows($resultID1) < 1)
{
print "There has been an internal error. We apologise for this please try again later";
}
else
{
$places =$row['placesavailable'];
$places --;
$result = mysql_query("UPDATE rsu SET placesavailable = '$places' where CourseID = '$courseid'", $linkID)or die(mysql_error());
}Many thanks in anticipation
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]