PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 30th, 2003, 05:51 AM
velocityX velocityX is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 72 velocityX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 36 sec
Reputation Power: 6
Send a message via AIM to velocityX
php mysql code error

whats wrong with this???
PHP Code:
 $query="INSERT INTO maps_admin (admin_name) VALUES (' . $_GET['values'] . ')"

Reply With Quote
  #2  
Old July 30th, 2003, 07:20 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
You're using the concatenation operator within a string, so the query you're actually sending mysql is (assuming $_GET['values'] is "test"):

Code:
INSERT INTO maps_admin (admin_name) VALUES(' . test . ')


Change your line to:

PHP Code:
 $query="INSERT INTO maps_admin (admin_name) VALUES ('" $_GET['values'] . "')"


and see how that works.

Reply With Quote
  #3  
Old July 30th, 2003, 12:59 PM
velocityX velocityX is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 72 velocityX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 36 sec
Reputation Power: 6
Send a message via AIM to velocityX
still doestn work

Reply With Quote
  #4  
Old July 30th, 2003, 03:46 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Hmmm, I think somebody in another instance of this thread recommended that you add a die(mysql_error()) statement to the line in which you execute the query. This should help you narrow down the bug. Do you have your field named correctly? (Case matters.) Also try echoing your query and pasting it manually into the command line tool to see what that nets you. What's the precise error message you're getting? Have you selected a database to use? Was it the right one? Are you sure you're actually connected?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > php mysql code error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway