Page 1 of 1

[MySQL] Weird "Query"

Posted: Wed Apr 05, 2006 6:24 am
by powerPT

Code: Select all

$cliente = $_POST['listaclientes'];
$servico = $_POST['listaservicos'];

$idcliente = mysql_query("SELECT id FROM clientes WHERE nome='{$cliente}'");
$idservico = mysql_query("SELECT id FROM servicos WHERE nomeservico='{$servico}'");

echo $idcliente;
echo $idservico;
A part of my code...

The result of this query:
Resource id #3Resource id #4
The result would be another IDs, by the way this Ids doesn´t exist! :roll:

Posted: Wed Apr 05, 2006 6:43 am
by JayBird
All you have done is got a results resource. You now need to do something with it.

have a look at mysql_fetch_assoc() for examples