PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
tarja311
Forum Commoner
Posts: 73 Joined: Fri Oct 20, 2006 10:57 pm
Post
by tarja311 » Mon Jan 22, 2007 5:30 pm
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>";
}
jammr
Forum Newbie
Posts: 16 Joined: Mon Jan 22, 2007 12:10 am
Post
by jammr » Mon Jan 22, 2007 6:06 pm
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.
tarja311
Forum Commoner
Posts: 73 Joined: Fri Oct 20, 2006 10:57 pm
Post
by tarja311 » Mon Jan 22, 2007 9:15 pm
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.
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Mon Jan 22, 2007 9:26 pm
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>";
}
tarja311
Forum Commoner
Posts: 73 Joined: Fri Oct 20, 2006 10:57 pm
Post
by tarja311 » Mon Jan 22, 2007 9:37 pm
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.
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Mon Jan 22, 2007 9:52 pm
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?
tarja311
Forum Commoner
Posts: 73 Joined: Fri Oct 20, 2006 10:57 pm
Post
by tarja311 » Mon Jan 22, 2007 9:59 pm
Yes they do.
(?w=result&cmd=filename&id=31)
and
(?id=31)
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Mon Jan 22, 2007 10:00 pm
And a var_export($_GET) in tooltip.php only shows array()? Sorry, I'm clueless then.
tarja311
Forum Commoner
Posts: 73 Joined: Fri Oct 20, 2006 10:57 pm
Post
by tarja311 » Mon Jan 22, 2007 10:30 pm
i appreciate your help though.
Mohamed
Forum Newbie
Posts: 21 Joined: Fri Jan 19, 2007 6:59 pm
Location: Seattle
Post
by Mohamed » Tue Jan 23, 2007 1:43 pm
which php version are you using?
have you tried $HTTP_POST_VARS
tarja311
Forum Commoner
Posts: 73 Joined: Fri Oct 20, 2006 10:57 pm
Post
by tarja311 » Tue Jan 23, 2007 7:43 pm
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.
Kieran Huggins
DevNet Master
Posts: 3635 Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:
Post
by Kieran Huggins » Tue Jan 23, 2007 8:32 pm
is it just me, or shouldn't that earlier code have been:
Code: Select all
$_SESSION[$id] = $file; // instead of $_SESSION['id'] = $id_file;
Kieran Huggins
DevNet Master
Posts: 3635 Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:
Post
by Kieran Huggins » Tue Jan 23, 2007 8:34 pm
if it's ajax and tooltips ye be needing, check out jquery!