Gossamer Forum
Home : General : Internet Technologies :

Getting results, but not passing back values?

Quote Reply
Getting results, but not passing back values?
Hi. I'm using the following script;

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? Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Getting results, but not passing back values? Andy 5144 Jun 5, 2003, 9:03 AM
Thread Re: [Andy] Getting results, but not passing back values?
hennagaijin 4876 Jun 5, 2003, 1:16 PM
Thread Re: [hennagaijin] Getting results, but not passing back values?
Paul 4839 Jun 5, 2003, 2:40 PM
Post Re: [Paul] Getting results, but not passing back values?
hennagaijin 4883 Jun 5, 2003, 4:37 PM
Post Re: [hennagaijin] Getting results, but not passing back values?
Andy 4856 Jun 6, 2003, 12:47 AM