General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL 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:
  #1  
Old March 28th, 2004, 11:13 PM
philip pluckros philip pluckros is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 6 philip pluckros User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cant INSERT more than 2 fields at once

I have a strange problem inserting data to my database.
The script below works perfectly

<?php
printf ("Name =%s<br>",$name);
printf ("Style =%s<br>",$style);
printf ("Address=%s<br>",$address);

$db=mysql_connect("localhost","xxx","xxx");
mysql_select_db("xxx",$db);
$sql = "INSERT INTO xxx (name,style) VALUES ('$name','$style')";
mysql_query ($sql,$db);
?>

As soon as I change the query line to the following nothing works !!

$sql = "INSERT INTO xxx (name,style,address) VALUES ('$name','$style','$address')";

$Address does contain valid data, I have tested that by printing it at the start of the script.
This is even the exact SQL script which MySQL Admin generates when I do it manually and that DOES work.

It seems to be limiting me to inserting only two fields at a time, if I submit $name & $address it works, add $style to the query and nothing again !!

Can anyone please help !!
This is driving me nuts !

Thanks
Phil.

Reply With Quote
  #2  
Old April 21st, 2004, 01:10 PM
Unquick1 Unquick1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 5 Unquick1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
pop a echo infront of you $sql ....

echo $sql = "INSERT INTO xxx (name,style,address) VALUES ('$name','$style','$address')";

and make sure the query looks ok in the first palce.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Cant INSERT more than 2 fields at once


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 | 
  
 





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