rich_greeny
-
Posts
6 -
Joined
-
Last visited
Never
Posts posted by rich_greeny
-
-
sorry to be annoying, but can you expand on that? I'm not the most proficient mysql/php user, but we've all got to start somewhere!
-
thanks for those replies. I tried the first suggestion, and now i return single results, but in error form, stating "Wrong parameter count for mysql_result() ".
Any ideas on this one? -
hi everyone, i'm new here and a bit of a php/mysql noob too. I'm trying to call the last posts from the forum to put on the index of my website, and the only output i've managed to squeeze out is "Array Array Array Array". Which is a little frustrating!! Heres the code, any ideas?
[code]<?php
$MySQL_hostname = "localhost";
$MySQL_username = "****";
$MySQL_password = "****";
$connection = @mysql_connect($MySQL_hostname,$MySQL_username,$MySQL_password) or die("Couldn't connect");
$db_name = "****";
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database");
$table_name = "phpbbmem_posts";
$result = mysql_query("SELECT * FROM $table_name ORDER BY post_time DESC LIMIT 4");
while ($row = mysql_fetch_array($result)) {
$idTopic = $row["topic_id"];
$idPoster = $row["poster_id"];
$user=mysql_fetch_array(mysql_query("SELECT username FROM phpbbmem_users WHERE user_id='$idPoster'"));
$thread=mysql_fetch_array(mysql_query("SELECT topic_title FROM phpbbmem_topics WHERE topic_id='$idTopic'"));
echo "<tr style=\"width: 40%;\" height=\"0\" border=\"1\" bordercolor=\"black\">$thread</tr>\n";
echo "<tr style=\"width: 20%;\" height=\"0\" border=\"1\" bordercolor=\"black\">$username</tr>\n";
}
mysql_close();
?>[/code]
Thanks in advance. -
wooo, thanks a bunch. I've done small amounts of programming, but the whole 'not defining the variables' kind of threw me!
Thanks -
Hi all, i'm new to php and mysql, but starting to get the hang of it with my comp sci student housemate. I'm trying to return values inserted via a text box, but the top entry in the database won't display. If you add another to the database, then it appears, anyone have any ideas, or code to resolve the issue?
Cheers
Rich
[blockquote]$sql = "SELECT * FROM $table_name ORDER BY 'date' DESC";
$result = mysql_query($sql,$connection) or die("Couldn't execute SELECT query");
$row = mysql_fetch_array($result);
while ($row = mysql_fetch_array($result)){
echo "<tr>
<td style=\"width: 87px;\" height=\"0\"> </td>
<td>$row[notice]
</td>
</tr>";
}
mysql_close();
?>[/blockquote]
Trying to Call the last posts to phpbb -- having trouble!!
in MySQL Help
Posted