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]


Reply via email to