Jump to content

I need this, here.


fizzzgigg

Recommended Posts

I tried doing functions and all that... I am just can't seem to figure it out. If someone could help me or point me in the right direction, that would be awesome!

 

I need this following script:

<?PHP
include('functions.php');

$query = "SELECT DISTINCT name FROM homework WHERE uid='$loggedin' ORDER BY id ASC";
$result = mysql_query($query);

while ($myrow = mysql_fetch_array($result))
{
echo $myrow['name']."<br> ";

}
?>

That script needs to be executed in the sidepanel where the word "hello" is in this script:

<?PHP
include('functions.php');

$linktent = '<div class="titler">Your Pictures</div><div class="contentm">'.$data[index].'</div>';
$excess = '<div class="titlerex">Past Assignments</div><div class="contentmex">'."hello".'</div>';
echo getlyt($title, $linktent, $excess);

 

Any help would be greatly appreciated.

 

Adam

Link to comment
https://forums.phpfreaks.com/topic/222964-i-need-this-here/
Share on other sites

UPDATE:

I have it fixed but not completely. There should be two rows populated but I am getting one.

<?PHP
include('functions.php');
$query = "SELECT DISTINCT name,pid FROM homework WHERE uid='$loggedin' ORDER BY id ASC";
$result = mysql_query($query);

while ($myrow = mysql_fetch_array($result))
{
$display = "<a href=myphotos.php?pid=".$myrow['pid'].">".$myrow['name']."<br>";
}
$title = 'Light Graspers Certification';
$linktent = '<div class="titler">Your Pictures</div><div class="contentm">'.$data[index].'</div>';
$excess = '<div class="titlerex">Past Assignments</div><div class="contentmex">'.$display.'</div>';
echo getlyt($title, $linktent, $excess);

 

 

But it works just fine in test.php file by itself... as in I get the correct results.  Any guesses?

<?PHP
include('functions.php');

$query = "SELECT DISTINCT name,pid FROM homework WHERE uid='$loggedin' ORDER BY id ASC";
$result = mysql_query($query);

while ($myrow = mysql_fetch_array($result))
{
echo "<a href=myphotos.php?pid=".$myrow['pid'].">".$myrow['name']."<br> ";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/222964-i-need-this-here/#findComment-1152852
Share on other sites

QuickOldCar:

 

I put echo all throughout the script and I constantly received errors? Besides isn't the script being echoed in the very end?

$excess = '<div class="titlerex">Past Assignments</div><div class="contentmex">'.$display.'</div>';
echo getlyt($title, $linktent, $excess);

It needs to be in the $excess area due to the div placement.

 

thorpe:

$loggedin is stored in functions.php

Link to comment
https://forums.phpfreaks.com/topic/222964-i-need-this-here/#findComment-1152864
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.