Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. this line if ("'{$_POST['creditsamount']}' > (mysql_num_rows($result)") doesn't make any sense! or this one! mysql_query("INSERT INTO smf_members WHERE id_member = '{$_POST['memberid']}' (points) VALUES('-{$_POST['creditsamount']}' ) ") //can i make a - sign here? or die(mysql_error()); make what sign ?
  2. Or just add a counter to the loop $i++
  3. this is the exact code you should be using if(mysql_num_rows($result) == 0) //if member id and creditpass didn't match do: { echo "An error occured: <br /> Your member id and/or creditpassword didn't match. Please try again"; die(); }
  4. LOL, sorry it should be if(mysql_num_rows($result) == 0); / I normally write is the other way (if a user is found then so XYZ) so kinda missed the error
  5. try these changes, to get a bit of debug info //validating credit password $select = "SELECT member_id FROM smf_themes WHERE idmember_ = '{$_POST['memberid']}' and credits = '{$_POST['creditpass']}'"; $result = mysql_query($select, $con) or die($select.mysql_error()); //update $row = mysql_fetch_array($result); //debug echo "SQL: $select<br />/n"; var_dump($row); //end debug if(mysql_num_rows($result) > 0); //if member id and creditpass didn't match do: { echo "An error occured: <br /> Your member id and/or creditpassword didn't match. Please try again"; die(); }
  6. options #1. upload image to a folder, rename it to the usersID.jpg then have a field in the uers table called avatar set to usersID.jpg #2. store the image in a blob in the database and then create a php file to emulate the image, ie <?php header('Content-Type: image/jpeg'); //connect to database $SQL = sprintf("SELECT Image FROM table WHERE userid=%d LIMIT 1",$_GET['id']); $r = mysql_query($SQL); $row = mysql_fetch_row($r); echo $row['Images']; ?>
  7. this should be fine if(mysql_num_rows($result) > 0);
  8. When an image's data is written to a file, it stored the data from top to bottom, so if the image shows (just say) 10% then messes up, and fails to show the rest, then it would probably mean the data is damaged, create a backup and them add another image and try viewing that, also check if theirs a limit on the amount of data that field can hold
  9. They are either not identical or something is being changed during the (code continue)
  10. To put is simply you can assign two fields the same auto_increment value in one query, you could create an update to update the pod_no to the same as the last id. but i still don't see why you would want this!
  11. Why even have pod_no if its the same as pod_id ?
  12. change $result = mysql_query($select, $con); to $result = mysql_query($select, $con) or die($select.mysql_error()); and check the error
  13. It seams so, No buy a beer feature on this forum, but I maybe add it to a wish list lol, in my RegEx i did capture "genres" as I this maybe useful later! but you know the system better than me
  14. Why..the values would be the same.. so whats the point ?
  15. no windows XP doesn't come with a mail server, try googling for one windows xp mail server the software depends on your spec, (features, price, etc)
  16. I'm not sure what your asking here, But for both URL's your could create 1 complex regex but 2 would be easier to manage, RewriteRule ^movies/([^/]+)/[^/]+/(\d+)/page/(\d+) /browse.php?type=1&option=$1&option_value=$2&page=$3 [L] RewriteRule ^movies/page/(\d+)/([^/]+)/[^/]+/(\d+) /browse.php?type=1&option=$2&option_value=$3&page=$1 [L]
  17. I can't make sense of the logic your using, why are use counting the rows ?! $pass += (6 * mysql_num_rows($sql)); and in the excel what's X9 related to ?
  18. anywhere below public_html, ie /hidden/ <--here /private/SWF/ <--here etc
  19. The other reason for using LIMIT 1 is to stop SQL searching for more after its found one, and considering only 1 should be found this helps with performance
  20. The Fastest way really depends on what you want as a end result. you could do this in the query UNIX_TIMESTAMP(thedate) as unixTime then check unixTime > 0 strtotime('0000-00-00 00:00'); works fine (on an up-to-date system) or even (as you suggested) if($str == "0000-00-00 00:00")
  21. if the paidto is set in the future (from when they paid) (ie they have paid up to that date) then anyone found has a valid membership wouldn't that use a few extra bytes of memory!! LOL Its all down to personal preference, I guess! but I try to keep in mind what makes upgrades quicker and safer
  22. Just use sessions ie <?php session_start(); //login check $_SESSION['UserGroup'] = $row['group']; //... ?> <?php session_start(); if($_SESSION['UserGroup'] < 2) //whatever! { die("No Access"); } header('Content-type: application/x-shockwave-flash'); readfile("../category/01.swf"); //folder outside/below the public folder ?>
  23. I know, I asked why, but didn't get a reply, so I thought I'll give a dirty example!
  24. You don't need to drop any values, if the paid for a subscription to until 06/24/2010 then you just need to compare to the current date ie SELECT * FROM payements WHERE paidto >= CURDATE(); Personally I find it quicker to do (30*24*60*60), its quicker to debug and update vs microseconds to process! infact i just ran a benchmark, 5000 iterations it seams sometimes mine is quicker!, which is kinda unexpected! 0.00063268013000488 //pkedpker 0.00069262042045593 //mine
  25. As for a quick simple php solution you could create the links like this <a href="http://www.mydomain.com/redirect.php?link=http://blar.com">http://www.blar.com</a> <?php //write log to text file or SQL header(Location: $_GET['link']); ?>
×
×
  • 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.