Hi. I'm using the following script;
$connection = mysql_connect($host, $username, $password); $error = mysql_error();
if (!$connection) { error("Unable to connect with your login info for MySQL. Reason: $error", $connection); }
if ($debug) { echo "host connection established...."; } //a little something for debugging
// now we need to connect the database
$db = mysql_select_db($database, $connection); $error = mysql_error();
if (!$db) { error("Unable to execute command. Reason: $error", $connection); }
if ($debug) { echo "database connection established....<BR>"; } // a little debugging info if needed...
// get the links details...
$query = "SELECT ID FROM lsql_Links WHERE Title = '" . $sliced[1] . "' AND Contact_Name = '" . $sliced[6] . "' AND Contact_Email = '" . $sliced[7] . "'";
if ($debug) { echo $query . "<BR>"; }
$banner = mysql_query($query);
$error = mysql_error();
if (!$banner) { error("Unable to execute query to mySQL Database to get URL. Reason: $error. <BR><BR>Query was: $query", $connection); }
if ($debug) { echo "query executed....<BR>"; }
//get info we need...
while ($hit = mysql_fetch_array($banner)) {
echo $sliced[0] . "::" . $hit->{'ID'} . "<BR>";
}
the problem is, it returns the correct number of SQL results, but just won't pass the variables back (FYI, $sliced[] is defined earlier). It just prints stuff like;
2::
4::
7::
43::
54::
76::
Anyone got any ideas where I am going wrong?
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Code:
// connect to mySQL and if not pass back an error $connection = mysql_connect($host, $username, $password); $error = mysql_error();
if (!$connection) { error("Unable to connect with your login info for MySQL. Reason: $error", $connection); }
if ($debug) { echo "host connection established...."; } //a little something for debugging
// now we need to connect the database
$db = mysql_select_db($database, $connection); $error = mysql_error();
if (!$db) { error("Unable to execute command. Reason: $error", $connection); }
if ($debug) { echo "database connection established....<BR>"; } // a little debugging info if needed...
// get the links details...
$query = "SELECT ID FROM lsql_Links WHERE Title = '" . $sliced[1] . "' AND Contact_Name = '" . $sliced[6] . "' AND Contact_Email = '" . $sliced[7] . "'";
if ($debug) { echo $query . "<BR>"; }
$banner = mysql_query($query);
$error = mysql_error();
if (!$banner) { error("Unable to execute query to mySQL Database to get URL. Reason: $error. <BR><BR>Query was: $query", $connection); }
if ($debug) { echo "query executed....<BR>"; }
//get info we need...
while ($hit = mysql_fetch_array($banner)) {
echo $sliced[0] . "::" . $hit->{'ID'} . "<BR>";
}
the problem is, it returns the correct number of SQL results, but just won't pass the variables back (FYI, $sliced[] is defined earlier). It just prints stuff like;
2::
4::
7::
43::
54::
76::
Anyone got any ideas where I am going wrong?
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

