0

hello
i want to know that how pass parameters to mysql query inside php function
i have written function but giveing me error

   error: mysql_fetch_array(): supplied argument is not a valid MySQL result resource


function d_loader($r_ip){   
global $con;
$result = mysql_query("SELECT * FROM table WHERE h_ip ='$r_ip'");

$row=mysql_fetch_array($result);}
2
Contributors
2
Replies
11
Views
5 Years
Discussion Span
Last Post by nova37
0

Tray adding or die(mysql_error()) to the end of your query to see if that helps with finding out what is going wrong:

$result = mysql_query("SELECT * FROM table WHERE h_ip ='$r_ip'") or die(mysql_error());
0

ya thanks for that .... i find where is problem :D

or die(mysql_error());

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.