Jump to content

R1der

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Everything posted by R1der

  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
  13. Glad ya sorted it, *Wonders if he helped* lol
  14. All depends Cant you add a query To say like if thay have not paid then exit the script? Not sure like i have never had to do it.. so i dont know if it can be done with a 'if' statment But i am sure there must be a way to do it..
  15. kk thanks for all your help..
  16. How about something like this.. would this work? $post['post']=str_replace(array("<", ">","\'"), array("<", ">", "'"), $post['post']); Would that work to protect it?
  17. Ok it worked once i removed that.. So how can i protect the text box now from SQL injections?
  18. Oh i got told that would protect the textbox from SQL injections
  19. Get them to click a 'Forgot password link' then have it email them with a link so thay can reset there password. Would that work?
  20. But i dont want it to insert '0' lol It's a advertisement thing so thay type something and it shows.. i.e thay type.. 'I am selling crystals' and it should insert "I am selling crystals" but its not its inserting '0' Get what i mean?
  21. No it posts but instead of it showing what thay typed in it puts a '0' the database type is varchar(255)
  22. Nope that did'nt work either I know i looked at it for a good 2 hours yestaday and couldnt spot anything i even tried rewriting it and still for the same thing.
×
×
  • 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.