View Full Version : Any PHP/MySQL experts?
stracing
10-12-2004, 09:31 AM
i'm just having a small problem.
i'm trying to enter about 30 data elements all at once but it seems mysql won't let me. could it be because it has a maximum command length? i tried searching on the web and nothing has came up
anyone have ideas what to do?
my idea was to use insert and then update. but would that affect data being changed accidently?
bondw23
10-12-2004, 09:37 AM
is there no error being given when you try to run the query ?
stracing
10-12-2004, 09:44 AM
no because i'm running it in my php script
but i copied and pasted into my mysql window and even then the whole command doesn't fit
my code is like $num=(insert into db (data1, data2,...data30) values (data1, data2,...data30);
when i copy that into mysql window it cuts off at about 'values'
stracing
10-12-2004, 11:13 AM
programming is a bitch...just like women so god damn picky!!!!!!
i copied and pasted my code here and there and double checked my syntax was correct but nooooooooooooooooooo it doesn't work
instead i had to type out every single god damn mot#$#@#$%#@ing letter out and then it worked
fucking son of a bitch!!!!
sorry for the mild use of profanity
XTwinTurboVR4X
10-12-2004, 12:03 PM
eh no problem.. php/mysql drives me nuts too sometimes (also still learning it) , but generally errors are typo's I made or wrong syntax :-|
The Transporter
10-13-2004, 03:36 AM
Usually SQL query in php are constructed like that:
$sql = "INSERT INTO my_db (name,firstname,sex)
VALUES ('$name','$firstname','$sex')";
$con = mysql_connect($host,$login,$password);
mysql_select_db($base);
$result = mysql_query($sql);
// Parse it now
while ($row = mysql_fetch_object($result))
{
echo "$row->name,$row->firstname,$row->sex
";
}
mysql_close($con);
If you need more help, just ask :p
PS: If you dont see me around these days it's because I have a montain of work .... But be sure, I'll be back soon, I have alot of pics to show :)
vBulletin® v3.8.7, Copyright ©2000-2026, vBulletin Solutions, Inc.