PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?
$db=mysql_connect("localhost","user","pass") or die ("cant connect");
mysql_select_db("wsn",$db) or die ("cant change");
if ($submit){mysql_query(insert into news values="$author,$title,$date,$content")) or die ("cant post")};
?>
<form action="<?echo="$PHP_SELF?">" method=POST>
userneme<input type="text" size=11 name="author"><p>
title <input type ="text" size=11 name="title"><p>
content<textarea cols=20 rows=20 name="content"></textarea><p>
<input type="submit" name="submit" value="submit">
</form>
please help me figure out what is wrong with the scripting
Did you make the currect Database with all the correct tables?
Did you get all of your database login info correct?
I know these are simple questions, but sometimes thats the problem.
<?
$db=mysql_connect("localhost","user","pass") or die ("cant connect");
mysql_select_db("wsn",$db) or die ("cant change");
if ($submit){mysql_query(need quote here, not using $_POST for variables insert into news values="dont think values uses =$author,$title,$date,$content")) or die ("cant post")};no ;
?>
<form action="<?echo="$PHP_SELF?">"have a quote where it shouldn't be method=POST>
userneme<input type="text" size=11 name="author"><p>
title <input type ="text" size=11 name="title"><p>
content<textarea cols=20 rows=20 name="content"></textarea><p>
<input type="submit" name="submit" value="submit">
</form>
thanks for the help i know for a fact that i have the sql database and tables mead corectly and when i used the scipt provided by Sevengraff i get a Parse error on line 7 it sayes its expecting 'T_STRING' or `T_VARIABLE' or `T_NUM_STRING' thanks for the help
mysql_query("INSERT INTO news VALUES('{$_POSTї'author']}', '{$_POSTї'title']}', '{$date}', '{$_POSTї'content']}');") or die("Cant post");