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
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
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
Share on other sites

QuickOldCar is right. You need to concatenate the results together. (note the .= operator)

 

$display .= "<a href='myphotos.php?pid={$myrow['pid']}'>{$myrow['name']}</a><br>";

 

Your html wasn't valid either so I fixed that as well.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.