mysql_num_rows error

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
peterachutha
New php-forum User
New php-forum User
Posts: 10
Joined: Sat May 31, 2014 10:35 pm

Fri Jun 06, 2014 3:35 pm

I'm new to mysql but I noticed that if I used

$query = "SELECT ip FROM hits_ip WHERE ip = $user_ip;";

the code did not work but if I had used

$query = "SELECT ip FROM hits_ip WHERE ip = '$user_ip' ;";

or in some cases

$query = "SELECT ip FROM hits_ip WHERE ip = '".$user_ip.'" ;";

the code worked. I do not know why, as yet. ... possiblythat the php value is transferred into the query string.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest