Jump to content

rich_greeny

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rich_greeny's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. valid resource and row offset? Do you mean that the variables i'm calling are incorrect? because they're in my database under the correct albums!
  2. 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!
  3. 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?
  4. 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.
  5. wooo, thanks a bunch. I've done small amounts of programming, but the whole 'not defining the variables' kind of threw me! Thanks
  6. 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]
×
×
  • 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.