A
Anonymous
Guest
I have the following code, which functions properly as is, but when I try to bring in data from a form or just simply create a variable in the code, it doesn't execute properly. (e.g. I want to say $x = 5. If I put this in the code, nothing will execute.) Any ideas what is wrong?
<?php
// Make a MySQL Connection
mysql_connect ("localhost", "username here", "password here") or die (mysql_error());
mysql_select_db ("Botag") or die (mysql_error());
// Insert a row of information into the table "example"
$query = "INSERT INTO articles ( title , author, art_text, art_date )
VALUES (
'titlehere2', '30', 'text', '0000-00-00 00:00:00'
)";
mysql_query($query) or die(mysql_error());
echo "Data Inserted!";
?>
<?php
// Make a MySQL Connection
mysql_connect ("localhost", "username here", "password here") or die (mysql_error());
mysql_select_db ("Botag") or die (mysql_error());
// Insert a row of information into the table "example"
$query = "INSERT INTO articles ( title , author, art_text, art_date )
VALUES (
'titlehere2', '30', 'text', '0000-00-00 00:00:00'
)";
mysql_query($query) or die(mysql_error());
echo "Data Inserted!";
?>