[MySQL] Weird "Query"

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
powerPT
Forum Newbie
Posts: 14
Joined: Tue Apr 04, 2006 2:25 pm
Location: Portugal

[MySQL] Weird "Query"

Post 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:
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post 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
Post Reply