this is the error
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line
Code: [Select]<?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>nn";
}//end while-
print "</table>n";
} else {
trigger_error(mysql_error(),E_USER_WARNING); //this will display MySQL's error message
}
}
mysql_close($con)
?>
Code: [Select]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
TabControl Inside ListView Not Editing
Hello everybodyI have a ListView on my page. Inside the ListView I put a TabControl, cuz I want to put different input controls on seperate pages. The problem is that changes made by the user in the
Passing Variables
What I'm wanting to do is when the user clicks on Arenas it will know the name of the country it's wanting to see the list of Arenas for but don't know how to pass it. I'm sure it's with a hidden
New to PHP and just trying to understand a little code.
I hope I'm not annoying anyone or breaking the rules but I was wondering about this bit of code right here: " <?php$people = Array(Array('name' => 'Kalle', 'salt' =>
Filtering for a phrase using pregmatch
Here is my code which looks for addresses which start with ' src=" 'Code: [Select]preg_match_all('#src="(http://[^"]+)#', $value, $matches)I want to modify this so that it only returns
storing video files into mysql in php
hi i have my video files in my folder ,i have to store the path of the videos into db and the play it in the player from the database.thanking in advance
PHP Include w/If IE Condition Statement?
I was having a problem with Internet Exploder (big surprise, right?) displaying my drop down menus improperly. I found a solution that works ... I have a PHP file that I place as an include on all my
Something Non-Traditional. Can we solve?
I have an idea for an application here. It's mostly flash, but it couldn't work without a somewhat non-traditional php functionality.here's the thing:I want to have a function which returns an
str_replace help
I am thinking str_replace is my only option to filter outputs from my database to convert them to safe url variables.I am working with a database with over 4million records, and apparently when the
curl javascript problem
Hi Experts.I'm new curl and wanna to get some info from this http://www.amadeus.net/when user enter some city name,the page suggest a list and then user select one of them.then user click a button and
How would I do "Users not logged in since *** delete them"
I know how I would set this up, and delete the user roughly.I'll create a table called "Users Status" with ID, Username, date registered, and last logged in collumns. Last Logged in will be