Hi,
im trying to write a code which writes and reads a string in a field of a table, but i get this error below at the line that starts with "$row = mysql_fet..."
Code:
"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in /opt/lampp/htdocs/Sites/prueba.php on line 23"
This is the code:
PHP Code:
<?php
$nombre="Javier";
$nombre2;
if (!($link=mysql_connect("localhost","","")))
{
echo "Error conectando a la base de datos.";
exit();
}
mysql_db_query("ejemplo", "insert into clientes(nombre) values('$nombre')");
$result = mysql_db_query("ejemplo", "select * from clientes");
$row = mysql_fetch_array($result);
echo $row["nombre"];
?>
Anyone can help me?
Ciao