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.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 12-22-2006, 07:00 PM   #1
amateurcanada
Confirmed User
 
amateurcanada's Avatar
 
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
amateurcanada is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 12-23-2006, 01:43 PM   #2
jonblaze9481
Registered User
 
Industry Role:
Join Date: Jun 2003
Posts: 22
Quote:
Originally Posted by amateurcanada View Post
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);
Ok, my PHP is a bit rusty but try this and see if it works....

----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
jonblaze9481 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 12-23-2006, 04:21 PM   #3
chonis
Confirmed User
 
Join Date: Oct 2005
Posts: 143
Quote:
Originally Posted by amateurcanada View Post
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);
Replace $modnum for $_GET['modnum'], I think that is your problem.
__________________
Exclusive Content From Argentina
ICQ - 272-213-644
chonis is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 12-23-2006, 05:49 PM   #4
pornlounge
Registered User
 
Join Date: Dec 2006
Posts: 6
consider the hint with the $_GET

also try [...] FROM ".$upTable." WHERE [...]

should work
__________________
Pornlounge - Daily Porn Blog

You have got a porn blog? Let's exchange links!
pornlounge is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 12-23-2006, 06:28 PM   #5
amateurcanada
Confirmed User
 
amateurcanada's Avatar
 
Industry Role:
Join Date: Jul 2001
Posts: 3,766
Quote:
Originally Posted by chonis View Post
Replace $modnum for $_GET['modnum'], I think that is your problem.
Hi there and thanks for the help, actually the variable itself is fine.. I am trying to load up the value within the program to display the model itself with the field ID

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
amateurcanada is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 12-23-2006, 10:08 PM   #6
bl4h
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)
bl4h is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 12-23-2006, 10:17 PM   #7
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
WHERE id = '" . $modnum . "' LIMIT 1
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 12-24-2006, 07:11 AM   #8
amateurcanada
Confirmed User
 
amateurcanada's Avatar
 
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
amateurcanada is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.