![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jul 2001
Posts: 3,766
|
php help, see example :)
Ok, what i want to do is have the sql load the page based on the modnum entered in the php line (text.php?modnum=1) - ive tried alot of == lines and get errors, how would u simplify this to work :D thanks alot guys! :d
/** SQL QUERY */ if(!isset($modnum)){ $sql = "SELECT id,up_date, up_modelname, up_age, up_from, up_description, up_moviename, up_length, up_buyvideo, up_modelset, keywords FROM $upTable WHERE LOWER(keywords) LIKE '%".$modnum."%' ORDER BY up_date DESC"; } $result = mysql_query($sql, $db_link);
__________________
![]() be our partner - join nichepartners today will.assum.producer @ AmateurCanada.com / icq: 30146166 / facebook.com/will.assum / #amateurcanada |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#2 | |
Registered User
Industry Role:
Join Date: Jun 2003
Posts: 22
|
Quote:
----Code---- if(isset($modnum)) { if($modnum==1) { $sql = "SELECT id,up_date, up_modelname, up_age, up_from, up_description, up_moviename, up_length, up_buyvideo, up_modelset, keywords FROM $upTable WHERE LOWER(keywords) LIKE '%".$modnum."%' ORDER BY up_date DESC"; } } Else { echo 'Variable Not Set'; } ----Code---- You should check to see if the variable $modnum has a value assigned to it. If so, then check to see if that value = 1. If it is, run the sql statement. Hope it helps. Blaze |
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Oct 2005
Posts: 143
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#4 |
Registered User
Join Date: Dec 2006
Posts: 6
|
consider the hint with the $_GET
also try [...] FROM ".$upTable." WHERE [...] should work |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Industry Role:
Join Date: Jul 2001
Posts: 3,766
|
Quote:
so modnum=1 would local database field with ID 1 $sql = "SELECT id, up_date, up_modelname, up_age, up_from, up_description, up_moviename, up_length, up_buyvideo, up_modelset, keywords FROM $upTable WHERE $modname=id ORDER BY up_date DESC"; now this would be the logical way, where modname=id but it doesnt load the value, just pulls the blank screen on me ![]()
__________________
![]() be our partner - join nichepartners today will.assum.producer @ AmateurCanada.com / icq: 30146166 / facebook.com/will.assum / #amateurcanada |
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Jul 2006
Location: Philadelphia
Posts: 1,282
|
well youre not showing us your code to read the result from mysql or anything. That may be where your problem is. ALso in your first example you use !isset, which means IF ITS NOT SET
the correct way is to use $_GET. Yes, for now it works otherwise, but its the correct way nor is it safe to use variables like that. Also, dont you mean: id=$modname ? try putting id='$modname' (with the comas) |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#7 |
MOBILE PORN: IMOBILEPORN
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
|
WHERE id = '" . $modnum . "' LIMIT 1
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Jul 2001
Posts: 3,766
|
Here is all the code, I hacked job a multipage tour file to attempt this...
[QUOTE=bl4h;11583990]well youre not showing us your code to read the result from mysql or anything[QUOTE]
================================================== ====== <? /** DATABASE CONNECTION */ $DBHOST = "localhost"; $DBLOGIN = "#####"; $DBPASSWORD = "#####"; $DB = "#####"; $memTable = "models"; $db_link = mysql_connect($DBHOST, $DBLOGIN, $DBPASSWORD); if(!mysql_select_db($DB, $db_link)) { echo "Unable to connect to the database server at this time."; exit(); } //SQL Query Selected depending if ?modname=MODELNAME is set in URL if(isset($modname)) { if($modname==1) { $sql = "SELECT id, up_date, up_modelname, up_age, up_from, up_description, up_moviename, up_length, up_buyvideo, up_modelset, keywords FROM $upTable WHERE id='$modname' LIMIT 1 ORDER BY up_date DESC"; } } else { echo '<CENTER><BR><BR><BR><B>Model not selected. Please try again...</B><BR><BR><BR></CENTER>'; } echo $modname; $result = mysql_query( $sql, $db_link ); /** NAVIGATION */ $perPage = 1; //set number of models per page to display //Evaluate current position of user if (!isset($srtCount) || $srtCount<=0){ $srtCount = 1; } $num_rows = mysql_num_rows($result); //get number of rows in db $nextCount=$srtCount+$perPage; $prevCount=$srtCount-$perPage; /** BASIC LISTING */ //Iterate through selections using $srtCount $count=0; while($count<$srtCount){ $rowarray = @mysql_fetch_row($result); $count++; } $i=0; while ($i<$perPage && $rowarray!=FALSE) { $sid = $rowarray[0]; $modelname = $rowarray[1]; $previewname = $rowarray[2]; $age = $rowarray[3]; $location = $rowarray[4]; $sexuality = $rowarray[5]; $maritalstatus = $rowarray[6]; $mycomments = $rowarray[7]; $producerscomments = $rowarray[8]; $turnons = $rowarray[9]; $hobbiesfun = $rowarray[10]; $sexual = $rowarray[11]; $height = $rowarray[12]; $weight = $rowarray[13]; $busty = $rowarray[14]; $food = $rowarray[15]; $photoset1 = $rowarray[16]; $photoset2 = $rowarray[17]; $photoset3 = $rowarray[18]; $photoset4 = $rowarray[19]; $photoset5 = $rowarray[20]; $photodir = $rowarray[21]; $videoloc = $rowarray[22]; $dvd1 = $rowarray[23]; $dvd2 = $rowarray[24]; $dvd3 = $rowarray[25]; $dvd4 = $rowarray[26]; $dvd5 = $rowarray[27]; $dvd6 = $rowarray[28]; $dvd7 = $rowarray[29]; $dvd8 = $rowarray[30]; $dvd9 = $rowarray[31]; $dvd10 = $rowarray[32]; ?> <!-- TEMPLATE --> where the output info goes<BR> <? echo $modelname; ?> <!-- END TEMPLATE --> <?php $i++; $rowarray = @mysql_fetch_row($result); }//end while @mysql_close($db_link); ?> ================================================== ====== Sorry to bug you guys with this ![]()
__________________
![]() be our partner - join nichepartners today will.assum.producer @ AmateurCanada.com / icq: 30146166 / facebook.com/will.assum / #amateurcanada |
![]() |
![]() ![]() ![]() ![]() |