Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2005, 03:22 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default putting something from the database into a session

This is not vbulletin related.

I am working on a script that is going fairly well but I need help on sessions.

On the databae I have a table named "style". It has css, tablewidth, cellpadding, cellspacing, alt1, alt2, and default_style.

If I were to type in "index.php?act=view&styleid=2" it will show the table layout from getting info from that database (Like vbulletin does.)

My problem is that I would like to put the "styleid" in a session.

Here's a code snippet if you need it

PHP Code:
$getstyle = mysql_query("SELECT * FROM requestv2_style WHERE styleid='{$_GET['styleid']}'")or die(mysql_error());
    $style = mysql_fetch_array($getstyle);
        
    if (!$style['styleid']) 
{    
    $gettable = mysql_query("SELECT * FROM requestv2_style WHERE default_style='yes'")or die(mysql_error());
     $table = mysql_fetch_array($gettable);
} else { 
     $gettable = mysql_query("SELECT * FROM requestv2_style WHERE styleid='{$style['styleid']}'")or die(mysql_error());
     $table = mysql_fetch_array($gettable);
} 
What it doing is seeing if it can get a style. If not then display where I set the default style. If so then display the table layout from that styleid.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:01 AM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.