Need help - query results don't display
Posted: Sat Jun 24, 2006 12:52 am
I'm trying to get what I think should be a fairly simple display of query results, but I can't get it to work.
Here's my php with the mysql query:
What I'm getting is just the ", completed on" and "end" with no data. I know the query itself works fine, so I'm guessing it has to do with the echo statement -- the only thing I can think of is that maybe having the "." within the field name is causing a problem?
Any suggestions?
Thanks,
Scott
Edit: missed a "." in the php code...
Here's my php with the mysql query:
Code: Select all
<?php
$link = mysql_connect('host', 'user', 'pass') or die('Could not connect: ' . mysql_error());
mysql_select_db('database') or die('Could not select database: ' . mysql_error());
$query = "SELECT CONCAT(t2.stored_questionnaire_ID, t1.questionnaire_name, t2.stored_questionnaire_date) AS Link FROM qst_questionnaires AS t1, qst_stored_questionnaires AS t2, mos_users AS t3 WHERE t1.questionnaire_ID = t2.questionnaire_ID AND t2.user_id = t3.id AND t3.username = 'username' ORDER BY t2.stored_questionnaire_date DESC";
$result = mysql_query($query) or die('Query failed: '.mysql_error());
while ($myrow = mysql_fetch_array($result)) {
echo "<a href=\"http:www.domain.com/index2.php?option=com_feedback&sqid=".$myrow["t2.stored_questionnaire_ID"]."\">".$myrow["t1.questionnaire_name"]."</a>, completed on ".$myrow["t2.stored_questionnaire_date"]."<br /><br />";;
}
echo "end";
mysql_free_result($result);
mysql_close($link);
?>Any suggestions?
Thanks,
Scott
Edit: missed a "." in the php code...