Hi, I am trying to do a mysql query but with a php variable in it.
Basically I am trying to make sure that no one puts more entries in the db than he/she is allowed. To do this I am checking the telephone numbers and counting the entries. This works fine when I put in a particular number but I can't get it to work for a variable.
$telephone = 647777111
$query = "SELECT *, count(*) as 'number' FROM `db` WHERE telephone = 647777111 group by name";
$result = mysql_query($query);
$data = mysql_fetch_array($result);
$number = $data['number'];
If I change the 647777111 above for $telephone - it doesn't work.
Not suprising - no. But I have no idea of how to do this.
Thanks a lot.