ok, i haven’t touch php in 2 years, and i have started using it again. i am having really trouble with inserting data in a mysql database, now the database conection is fine, and no error messages pop up. it just doesn’t enter the data. my code is below any help would be gd thank you.
[php]
<?php if (isset($do) && $do == 'add') { $my_t = getdate(date("U")); $date = $my_t[weekday] . $my_t[month] . $my_t[mday] . $my_t[year]; $sql="INSERT INTO News (date, title, news) VALUES ('$date', '$title', '$news')"; if (!mysql_query($sql,$conn)) { die('Error: ' . mysql_error()); } echo "1 record added"; $data = mysql_query( "SELECT * FROM News", $conn ) or die(mysql_error()); $image1 = $row['image1']; while ( $row = mysql_fetch_array( $data ) ) { print "" . $row['date'] . "
" . $row['title'];
print "
" . $row['news'] . "
";} // end while } mysql_close($conn) ?>
[/php]
ADMIN EDIT: Added [PHP] Code tags and adjusted format for readability