looking for a good person to help me with some site problems im having with php and mysql. thanks
need help with php and mysql
there is plenty of "good" help here. Great help in fact. But you will need to post the code in question that you need help with.
here is problem one i can send email out however no one is getting paid when its says you've been credited also more often than not it says you've already visited this link today. thanks
include('dbconnect.php');
?>
<html>
<head>
<title>Thank you</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#999999" text="#000000">
<table width="100%" border="0" cellpadding="0">
<tr>
<td>
<?
$mailcode=$HTTP_POST_VARS[mailcode];
$username=$HTTP_POST_VARS[id];
$sq=mysql_query("SELECT FROM reads WHERE fnum=$mailcode") or die("ERROR!");
$arr=mysql_fetch_array($sq);
extract($arr);
$sq=mysql_query("SELECT FROM mailreads WHERE fourid='$username' AND fmailnum=$fnum");
if(mysql_num_rows($sq))
{
echo"
<table width='100%' border='0' cellpadding='0'>
<tr>
<td height='18'>You have already visited this task today.</td>
<td width='65%' align='center'>";
$sql=mysql_query("SELECT FROM banners");
$rows=mysql_num_rows($sql);
$r=rand(0,$rows);
@mysql_data_seek($sql,$r);
@$arr=mysql_fetch_array($sql);
@extract($arr);
echo"<a href=out.php?url=$flink target=blank><img src=$furl border=0 alt='$falt'></a>";
$shows=$fshows+1;
mysql_query("UPDATE banners SET fshows=$shows WHERE fnum=$fnum");
echo "
<div align='center'></div></td>
</tr>
</table>
";
exit;
}
mysql_query("SELECT fprise, fpaytype FROM reads WHERE fnum='$mailcode'") or die(mysql_error());
$username = $HTTP_POST_VARS[id];
$sql=mysql_query("SELECT FROM users WHERE username='$username'") or die(mysql_error());
$arr=mysql_fetch_array($sql);
extract($arr);
if($fpaytype=='usd') {$tot=$ftmreads + $fprise; $sq=mysql_query("UPDATE users SET ftmreads=$tot WHERE username='$username'") or die(mysql_error());}
else if($fpaytype=='points') {$tot=$ftotalreads + $fprise; $sq=mysql_query("UPDATE users SET ftotalreads=$tot WHERE username='$username'") or die(mysql_error());}
if(mysql_affected_rows())
{
echo"<font face=verdana color=ffffff>Thank you for visiting
our sponsor! Your account has been credited!</font>";
$newread=$freads+1;
mysql_query("UPDATE reads SET freads=$newread WHERE fnum='$mailcode'") or die(mysql_error());
$sql=mysql_query("SELECT fnum AS num FROM reads WHERE fnum='$mailcode'") or die(mysql_error());
$arr=mysql_fetch_array($sql);
extract($arr);
mysql_query("INSERT INTO mailreads (fmailnum, fip, fourid) VALUES ($num, '$REMOTE_ADDR', '$username')") or die(mysql_error());
mysql_query("INSERT INTO activity(username, fdate, ftask) VALUES ('$username', now(), 'ptr')");
}
else echo"error";
mysql_free_result($sql);
?>
</td>
<td width="65%" align="center">
<?
$sql=mysql_query("SELECT * FROM banners");
$rows=mysql_num_rows($sql);
$r=rand(0,$rows);
@mysql_data_seek($sql,$r);
@$arr=mysql_fetch_array($sql);
@extract($arr);
echo"<a href=out.php?url=$flink target=blank><img src=$furl border=0 alt='$falt'></a>";
$shows=$fshows+1;
mysql_query("UPDATE banners SET fshows=$shows WHERE fnum=$fnum");
?>
<div align="center"></div></td>
</tr>
</table>
</body>
</html>
thanks so much for your help
Take a look at Debugging 101 (linkage in my .sig)....
it doesnt give a code or anything just doesnt credit or says already visited site today.
One of those Debugging 101 suggestions has the heading
"Leave @ off until later". Think about that when you look at these lines:
@mysql_data_seek($sql,$r);
@$arr=mysql_fetch_array($sql);
@extract($arr);
Another says "Always code with E_ALL on and do not generate any errors. " I'm betting your error reporting is set lower than this.
When posting code, help make it more legible by putting it between [php] and [/code] tags (like I did in the sample above).
(And on a side note - why are there still people out there using <font> tags?)