xtops
-
Posts
15 -
Joined
-
Last visited
Never
Posts posted by xtops
-
-
i already try your suggestion but still with this error
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line
and this error when i click submit button
Warning: Procedure IpPhoneDir.GetBranchBeg can't return a result set in the given context
-
this is the error
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line
<?php $srch = $_REQUEST["srch"]; if (empty($srch)) { print <<<HERE <form> Type the Store location: <input type = "text" name = "srch"> <input type = "submit"> </form> HERE; } else { $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($srch)")) { $um_rows = mysql_num_rows($result); if($num_rows <= 0) { echo "no match found"; } 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"; } else { trigger_error(mysql_error(),E_USER_WARNING); //this will display MySQL's error message } } mysql_close($con) ?>
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
-
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
-
ok i fixed it but new error found when i call my stored procedure
>CALL ValidateData('1111','test');
ERROR 1318 (42000): Incorrect number of arguments for PROCEDURE IpPhoneDir.ValidateData; expected 3, got 2
pls!! help whats wrong with this code
-
ok i fixed it but new error found when i call my stored procedure
>CALL ValidateData('1111','test');
ERROR 1318 (42000): Incorrect number of arguments for PROCEDURE IpPhoneDir.ValidateData; expected 3, got 2
plz help how to wrong with this code?
-
ok i fixed it but new error found when i call my stored procedure
>CALL ValidateData('1111','test');
ERROR 1318 (42000): Incorrect number of arguments for PROCEDURE IpPhoneDir.ValidateData; expected 3, got 2
-
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
DELIMITER // CREATE PROCEDURE ValidateData(IN in_IpPhno VARCHAR(30), in_loc VARCHAR(30), OUT out_status INT) MODIFIES SQL DATA BEGIN IF (!EXISTS(SELECT IpPhone, location FROM IpPhoneList WHERE IpPhoneNo = in_IpPhno OR location = in_loc;)) THEN set out_status = '1'; INSERT INTO IpPhonelist (IpPhoneNo, location) VALUES (in_IpPhno, in_loc); ELSE set out_status = '0'; END IF; END//
-
THANK YOU VERY MUCH.....IT WORKS
-
WHAT DO YOU MEAN SIR I DONT GET IT
-
Parse error: syntax error, unexpected $end in /var/www/borderMaker.php on line 3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> <head> <title>Your Output</title> </head> <body> <h1>Your output</h1> <center> <?php //$borderSize = $_REQUEST["borderSize"]; //$sizeType = $_REQUEST["sizeType"]; //$borderStyle = $_REQUEST["borderStyle"]; $theStyle = <<<HERE "border-width:$borderSize $sizeType; border-style: $borderStyle; border-color: green" HERE; print "<div style = $theStyle>"; print $basicText; print "</span>"; ?> </center> </body> </html>
-
gud day!!guro whats wrong with my program..my function readfile wont work..theres no error found and no display on tips.txt..they are on the same directory..
<html> <head> <title>Tip of the day</title> </head> <body> <center> <h1>Tip of the day</h1> <div style = "border-color:green; border-style:groove; border-width:2px"> <? readfile("tips.txt"); ?> </div> </center> </body> </html
-
why is that i cant view the ouput of the readfile function they are in same location.
no error found...is the some missing of my code
<html> <head> <title>Tip of the day</title> </head> <body> <center> <h1>Tip of the day</h1> <div style = "border-color:green; border-style:groove; border-width:2px"> <? readfile("tips.txt"); ?> </div> </center> </body> </html>
-
-
"Warning:mysql_fetch_field(): supplied argument is not valid MySQL result
resource in /var/www/test.php on line 23" how do i solved this pla help!!
i'm using ubuntu 8.04 server.
whats wrong with my code plz help!!!
in PHP Coding Help
Posted
TNX FOR THE REPLY
ONLY ONE ERROR EXIST when i click submit button
Warning: Procedure IpPhoneDir.GetBranchBeg can't return a result set in the given context
HOW FIX THIS