The LIMIT is irrelevant. It doesn't work with or without that there.
I put the die(mysql_error) in and the result wasn't very helpful...
I had another suggestion from a person saying to remove the first set of
column names to make the query like this:
$insert_query = "INSERT INTO news VALUES ('', 'asdf', '2001-03-19 00:33:47',
'1',
'asdf', 'asdf', 'asdf', '2') LIMIT 0, 30";
$insert_result = mysql_query($insert_query);
It works, but aren't those column names there for safety, to make sure the
values are placed in the correct columns?
Ryan Shrout
Production Manager
Athlonmb.com
http://www.athlonmb.com
[EMAIL PROTECTED]
----- Original Message -----
From: "Jason Landry" <[EMAIL PROTECTED]>
To: "Ryan Shrout" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 1:04 AM
Subject: Re: INSERT INTO Table problems
> What's the "LIMIT 0,30" for ?
>
> Also, you should probably do this:
>
> $insert_result = mysql_query($insert_query) or die(mysql_error());
>
> Then you wouldn't need to wait for an answer ;-)
>
>
> ----- Original Message -----
> From: "Ryan Shrout" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, March 18, 2001 11:39 PM
> Subject: INSERT INTO Table problems
>
>
> Okay, another question from the stumbling idiot: what's wrong with this
> code:
>
> $insert_query = "INSERT INTO news (NewsID, Title, Date, Author, Source,
> Link, Information, Status) VALUES ('', 'asdf', '2001-03-19 00:33:47', '1',
> 'asdf', 'asdf', 'asdf', '2') LIMIT 0, 30";
> $insert_result = mysql_query($insert_query);
>
> Anything?
>
> $insert_result is 0, which means it failed, and it DID fail because the
> entry is not in the database. What is weird, is that I copied and pasted
> that line from phpMyAdmin, which DID work!! I pulling my hair out!
>
> My eventual question will also be: is this a legal statement? :
> $insert_query = "INSERT INTO news (NewsID, Title, Date, Author, Source,
> Link, Information, Status) VALUES ($NewsID, $Title, $Date, $Author,
$Source,
> $Link, $Information, $Status) LIMIT 0, 30";
> $insert_result = mysql_query($insert_query);
>
> I guess I was just wondering if I need the ' ' around the variables like
> '$Title', etc.
>
> But, most importantly is that first question: why would it execute
correctly
> in phpMyAdmin, and then when I copy and paste the SQL-query from the
> "Modifications have been saved" line of phpMyAdmin into a PHP file, run
it,
> and it fail?
>
> Thank you for your assistance.
>
> Ryan Shrout
> Production Manager
> Athlonmb.com
> http://www.athlonmb.com
> [EMAIL PROTECTED]
>
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php