Page 2 of 2
Posted: Mon Jan 22, 2007 5:30 pm
by tarja311
Ok that makes sense. ty. Now i think i am getting somewhere. I can pull a '/tooltip.php?id=100' and actually see the data. Now i need to figure out why it's not displaying it in the tooltip. For some reason it does not like $_GET, cause it displays a blank tip.
Page 2
Code: Select all
if(isset($_GET['id']))
{
$id = $_GET['id'];
$tooltip = mysql_query("SELECT * FROM `". $my_result_table. "` WHERE `F_ID` = '$id'");
while($r = mysql_fetch_array($tooltip))
{
$file = $r["F_FILENAME"];
echo "Filename :". $file ."<BR>";
}
Posted: Mon Jan 22, 2007 6:06 pm
by jammr
You didn't end your if statement in that chunk of code
Code: Select all
if(isset($_GET['id']))
{
$id = $_GET['id'];
$tooltip = mysql_query("SELECT * FROM `". $my_result_table. "` WHERE `F_ID` = '$id'");
}
while($r = mysql_fetch_array($tooltip))
{
$file = $r["F_FILENAME"];
echo "Filename :". $file ."<BR>";
}
I'd also add an else to make sure you don't get any errors.
Posted: Mon Jan 22, 2007 9:15 pm
by tarja311
Fixed. But still no go. I don't know what's the matter. I performed a
and it returned "array ( )" I just don't get it.
It's weird cause it displays fine when i view it from tooltip.php?id=31.
Posted: Mon Jan 22, 2007 9:26 pm
by volka
Please post your current version of
tarja311 wrote:Page 1 - pulling data in from my database
Code: Select all
while($r = mysql_fetch_array($sql))
{
$id = $r["F_ID"];
$file = $r["F_FILENAME"];
echo "<TD><A HREF = '?w=result&cmd=filename&id=$id' onmouseover = ajax_showTooltip('tooltip.php',this);return false onmouseout=ajax_hideTooltip()>". $file ."</A></TD>";
}
Posted: Mon Jan 22, 2007 9:37 pm
by tarja311
Here ya go.
Code: Select all
while($r = mysql_fetch_array($sql))
{
$id = $r["F_ID"];
$file = $r["F_FILENAME"];
echo "<TD><A HREF = '?w=result&cmd=filename&id=$id'>". $file ."</A></TD>";
echo "<TD><A HREF = '#' onmouseover = ajax_showTooltip('tooltip.php?id=$id',this);return false onmouseout=ajax_hideTooltip()>". $details ."</A></TD>";
} // end while.
Posted: Mon Jan 22, 2007 9:52 pm
by volka
please try
Code: Select all
while($r = mysql_fetch_array($sql))
{
$id = $r["F_ID"];
$file = $r["F_FILENAME"];
$href = "?w=result&cmd=filename&id=$id";
$tooltip = "?id=$id";
echo "<TD><A HREF='" . $href. "'>". $file ."</A> (".$href.") </TD>";
echo "<TD><A HREF='#' onmouseover=ajax_showTooltip('tooltip.php'" . $tooltip . "',this);return false onmouseout=ajax_hideTooltip()>". $details ."</A>(".$tooltip.")</TD>";
} // end while.
and take a look at the newly printed values in (). Do they contain a valid id as expected?
Posted: Mon Jan 22, 2007 9:59 pm
by tarja311
Yes they do.
(?w=result&cmd=filename&id=31)
and
(?id=31)
Posted: Mon Jan 22, 2007 10:00 pm
by volka
And a var_export($_GET) in tooltip.php only shows array()? Sorry, I'm clueless then.
Posted: Mon Jan 22, 2007 10:30 pm
by tarja311
i appreciate your help though.

Posted: Tue Jan 23, 2007 1:43 pm
by Mohamed
which php version are you using?
have you tried $HTTP_POST_VARS
Posted: Tue Jan 23, 2007 7:43 pm
by tarja311
PHP 5
Well i've found the problem. In the Ajax script i did not have FF support. I realized this after viewing it in IE, and it worked.

I apologize for wasting everyones time. i really appreciate all the help.

Posted: Tue Jan 23, 2007 8:32 pm
by Kieran Huggins
is it just me, or shouldn't that earlier code have been:
Code: Select all
$_SESSION[$id] = $file; // instead of $_SESSION['id'] = $id_file;
Posted: Tue Jan 23, 2007 8:34 pm
by Kieran Huggins
if it's ajax and tooltips ye be needing, check out jquery!