Jump to content

help how to fix this error!!


xtops

Recommended Posts

 

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line 18

 

<?php

$con = mysql_connect("localhost","root","icebird");

if (!$con) {
  die('Could not connect: ' . mysql_error());
}
mysql_select_db("IpPhoneDir", $con);

/* Send a query to the server */
if ($result = mysql_query($con, "call GetBranchBeg('gsc')")) {
    print "<table border = 1>\n";
             
    //get row data as an associative array
   While ($row = mysql_fetch_assoc($result))
          { print "<tr>\n";
         //look at each field
           foreach ($row as $col=>$val){
            print "<td>$val</td>\n";
                            
           }//end foreach
    print "</tr>\n\n";
    
   }//end while-
   print "</table>\n";

}//end if

/* Close the connection */
mysql_close($con)
?> 


 

this is the content of my stored procedure

 

DROP PROCEDURE `GetBranchBeg`//
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetBranchBeg`(IN starts_with CHAR(15))
BEGIN
    DECLARE tmp CHAR(15); 
    SET tmp = CONCAT(starts_with, '%'); 
    SELECT IpPhoneNo, location FROM IpPhoneList WHERE location LIKE tmp OR location =starts_with;
END


 

 

 

Link to comment
https://forums.phpfreaks.com/topic/178717-help-how-to-fix-this-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.