R1der
-
Posts
104 -
Joined
-
Last visited
Never
Posts posted by R1der
-
-
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
-
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
-
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.
-
<?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] . "; } ?>
-
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 . .
-
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
-
Thanks guys your the best
-
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
-
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'
-
I thought it was set in that select query?
Sorry i am confused :S
-
So how would i do that?
-
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]'");
-
How do u mean?
-
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
-
Glad ya sorted it,
*Wonders if he helped* lol
-
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..
-
kk thanks for all your help..
-
How about something like this.. would this work?
$post['post']=str_replace(array("<", ">","\'"), array("<", ">", "'"), $post['post']);
Would that work to protect it?
-
Ok it worked once i removed that..
So how can i protect the text box now from SQL injections?
-
Oh i got told that would protect the textbox from SQL injections
-
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?
-
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?
-
No it posts but instead of it showing what thay typed in it puts a '0'
the database type is varchar(255)
-
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.
SELECT * Help
in PHP Coding Help
Posted
Thanks this worked great