Jump to content

R1der

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

R1der's Achievements

Member

Member (2/5)

0

Reputation

  1. It is not an error in the query. You need to loop through the results to get them all. $q=mysql_query("SELECT * FROM papercontent LIMIT 5",$c); //run the query. echo "<center><table width = '40%' border = '1'><tr><th> <center><u>Latest Announcements</u></center>"; //print the first part of the table. while($content=mysql_fetch_row($q)) { //while there are rows left in the database (fetch_row pulls a numeric array, fetch_assoc pulls an associative array) echo "<tr><td>{$content[0]}</td></tr></td>"; //print a new row, with the first column of the database row. } echo '</table>'; //close the table after all rows are finished. Thanks this worked great
  2. Thanks for your reply but changes what you said and get a error lol.. Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/crimcity/public_html/login.php on line 144
  3. Hi guys, I'm having a issue with a little bit of coding involving SELECT the problem is I want it to select from the database and say limit it to 5 so basicly it prints 5 results from the database but its only printing 1 result Here is the code i'm using $q=mysql_query("SELECT * FROM papercontent LIMIT 5",$c); $content=mysql_result($q,0,0); print " <center><table width = '40%' border = '1'><tr><th> <center><u>Latest Announcements</u></center> $content </tr></td></table> "; Thanks
  4. R1der

    error help

    Yea i relized i had the wrong database name in there so changed it . userdb is valid. Change that line of code but still get the same error.
  5. R1der

    error help

    <?php include("config.php"); $getEMails = mysql_query("Select * from userdb"); if(!$getEMails) { die("Error " . mysql_errno() . ": " . mysql_error()); } $loadMails = mysql_fetch_array($GetEMails); { $message = "ftest."; $subject = "test"; $sendto = "$loadmails"; mail($sendto, $subject, $message, $header); echo "Mail Sent To . $loadMails[email] . "; } ?>
  6. R1der

    error help

    Thanks for the replys.. I will start by saying i changed the uppercase "M" to a lowercase but still get the error. ok i also added the code you posted but still get the same error w/out error report Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/r1der1/public_html/emailall.php on line 13 Mail Sent To . .
  7. I have spent countless hours tryign to work out the problem here but failed. Please can someone fix this code for me? I get this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/*****/public_html/emailall.php on line 14 Mail Sent To . . <?php include("config.php"); $getEMails = Mysql_query("Select * from email"); $loadMails = mysql_fetch_array($GetEMails); { $message = "message here."; $subject = "subject here"; $sendto = "$loadmails"; mail($sendto, $subject, $message, $header); echo "Mail Sent To . $loadMails[email] . "; } ?> Thanks
  8. I am not sure if this is to do with the "SELECT" query but its only returning 1 result from the database. What have i done wrong? lol $get_horse = mysql_query("SELECT * FROM hracing ORDER BY id"); $horses = mysql_fetch_array($get_horse); echo"<br><Br>"; echo "<table width=100%>"; echo "<tr>"; echo "<td width=30%><b>Horse</b></td>"; echo "<td width=30%><b>Odds</b></td>"; echo "<td width=30%><b>Bet Cost</b></td>"; echo "<td width=30%><b>Bet</b></td>"; echo "</tr>"; echo "<td>$horses[name]</td>"; echo "<td>$horses[odds]</td>"; echo "<td>$horses[cost]</td>"; echo "<td><a href=hracing.php?action=$horses[name]>Bet</a></td>"; echo "</table>"; include("bottom.php"); Thanks for your time
  9. Basicly i want it to get the users ip address from the userdb where there 'id' is 'refer' then it will insert there ip address in the referals database being 'refid'
  10. I thought it was set in that select query? Sorry i am confused :S
  11. But like i said all the others insert fine so all you need to know is the refip one as that is the only one that dont insert. correct? mysql_query("SELECT * FROM userdb WHERE `ipaddress` = '$refip' AND `id` = '$_GET[refer]'");
  12. Ok i am trying to insert something into referals database but its not inserting the users ipaddress can anyone see a problem? mysql_query("SELECT * FROM userdb WHERE `ipaddress` = '$refip' AND `id` = '$_GET[refer]'"); mysql_query("INSERT INTO referals (id, refer, referip, referedip, refered) VALUES ('', '$refer', '$refip', '$ip', '$username')") or die(mysql_error()); All insert right except 'referip' Thanks
×
×
  • 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.