Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySql uppdate in php problem

Status
Not open for further replies.

matbli

Programmer
Aug 24, 2006
3
SE
Hi,

Have tried the following:

if($MyDataBase->query("select * from users where UserId='$UserId' and Password='$UserPw'")==0)
{
printf("<br/>%s<br/>",ShapeString(UNKNOWN_USER_OR_PASSWORD));

}
else
{
$MyDataBase->query("update users set NumberOfVisits = NumberOfVisits + 1 where UserId='$UserId' and Password='$UserPw'");

The first SQL query where i verify the user works fine. But the second one where I try to update a number of visits counter doesn't :-(. If I execute the same query from a MySQL GUI like SQLyog on the same db and table it works fine but not from PHP, why? Any suggestions appreciated.

/Mats
 
Disregard this. Had made a stupid mistake opening the wrong db :~/

/Mats
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top