-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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 ?
-
Or just add a counter to the loop $i++
-
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(); }
-
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
-
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(); }
-
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']; ?>
-
this should be fine if(mysql_num_rows($result) > 0);
-
php displaying part of binary image from MSSQL
MadTechie replied to doubleS's topic in Microsoft SQL - MSSQL
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 -
Replace quotation marks in a string with another character?
MadTechie replied to Punk Rock Geek's topic in PHP Coding Help
They are either not identical or something is being changed during the (code continue) -
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!
-
Why even have pod_no if its the same as pod_id ?
-
change $result = mysql_query($select, $con); to $result = mysql_query($select, $con) or die($select.mysql_error()); and check the error
-
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
-
Why..the values would be the same.. so whats the point ?
-
Fully Featured Mail Server on XP Professional
MadTechie replied to Vipul03's topic in Other Web Server Software
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) -
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]
-
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 ?
-
anywhere below public_html, ie /hidden/ <--here /private/SWF/ <--here etc
-
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
-
[SOLVED] php strtotime & 0000-00-00 00:00 (NULL) TIMESTAMP in MYSQL
MadTechie replied to pkedpker's topic in PHP Coding Help
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") -
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
-
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 ?>
-
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