NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Whats wrong with theis PHP?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
2 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 09-02-2005, 02:06 AM THREAD STARTER               #1 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Whats wrong with theis PHP?


heres the code:

PHP Code:
$query='update myfile_visitors set field02=\''.$browser.'\' where field01=\''.$_GET['field01'].'\', field03=\''.$_GET['field03'].'\'';
????: NamePros.com http://www.namepros.com/programming/120404-whats-wrong-with-theis-php.html
$result=mysql_query($query) or die("Could not execute the query:".mysql_error()); 
it returns the error:

Code:
Could not execute the query:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' field03=' - - none - -'' at line 1
But, I cant fgure out whats wrong with it..

what its trying to do is change field02 to broswer wherever field01 = their ip and field03 = their referer.
Barrucadu is offline  
Old 09-02-2005, 02:19 AM   #2 (permalink)
RJ
NamePros Admin


 
RJ's Avatar
Join Date: Feb 2003
Posts: 12,919
RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness
 



Find Marrow Donors! Cystic Fibrosis Parkinson's Disease
try for your query instead:

Code:
 $query='update myfile_visitors set field02=\''.$browser.'\' where field01=\''.$_GET['field01'].'\' and field03=\''.$_GET['field03'].'\'';
I just replaced your command with the word "and"
__________________
Reach me at rj at namepros dot com
RJ is offline  
Old 09-02-2005, 02:38 AM THREAD STARTER               #3 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




thanks
Barrucadu is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Getting started with PHP (The Basics) deadserious Webmaster Tutorials 60 11-17-2007 11:35 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
Tutorial: How to Install Apache2 MySQL and PHP on Windows deadserious Webmaster Tutorials 35 09-21-2005 09:46 PM
PHP Editor Software List Ber|Art Free Resources 3 08-22-2004 08:59 AM

 
All times are GMT -7. The time now is 12:13 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger