Posted by Michael Fesser on 02/07/07 18:17
..oO(tomhughes_86@hotmail.com)
>and the PHP script to add data:
><?
<?php
>$host="localhost"
>$username="root";
root?! You should create and use a normal user account.
>$database="test";
>
>
>$test2=$_POST['test2'];
Check with isset() if $_POST['test2'] exists.
>mysql_pconnect($host,$username);
mysql_connect(...);
>@mysql_select_db($database) or die( "Unable to select database");
>
>
>$query = "INSERT INTO test2 VALUES ('','$test2')";
>mysql_query($query);
No error handling. What does mysql_query() return? Or mysql_error()?
Is error_reporting set to E_ALL?
Micha
Navigation:
[Reply to this message]
|