Jump to content

newmedia

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

newmedia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=353938:date=Mar 11 2006, 10:58 AM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 11 2006, 10:58 AM) [snapback]353938[/snapback][/div][div class=\'quotemain\'][!--quotec--] Sure, no problem... and if you post some code, someone might be able to show you how! [/quote] ok! here's the code: <html><head> <link rel="stylesheet" type="text/css" href="../assets/<?php echo ($style) ?id=$id>"> </head> ^^^^not sure about this ------- <body> <?php include("../assets/dbinfo.inc.php"); mysql_connect(localhost,$username,$password) or die( "Error! Could not connect to database: " . mysql_error() ); $id = $_REQUEST['id']; // retrieve the row from the database $query = "SELECT * FROM `people` WHERE `id`='$id'"; ?> _____________ and here's the database: table : people fields: | ID | STYLE | NAME | SURNAME | etc... ------------------------------------------- records: | 1 | style1.css | John | Smith | .... ----------------------------------------- | 2 | style2.css | Tom | Jones | ...... it was something like that. I'm a real novice so may need more than a forum to save me but if you had any comments on whether mysql in the header will work that would be great.. anyone??
  2. Can anyone tell me.. is it possible to stick a mysql variable in the stylesheet reference in the header of a document or whould it have to follow the connect to database command further down the page? call me crazy but, i wanted to change the layout of a database record depending on its row $id.
  3. Can anyone tell me.. is it possible to stick a mysql variable in the stylesheet reference in the header of a document or whould it have to follow the connect to database command further down the page?
  4. [!--quoteo(post=353723:date=Mar 10 2006, 04:10 PM:name=mem0ri)--][div class=\'quotetop\']QUOTE(mem0ri @ Mar 10 2006, 04:10 PM) [snapback]353723[/snapback][/div][div class=\'quotemain\'][!--quotec--] Changing by session id, simply save the preferred CSS style into the database with the user (I'm assuming there is a user database...). Once the user logs in, the header href can point to the correct stylesheet by a php variable in the link path. Changing by row...like if you want alternating row colors or whatever...simply determine if the current row is dividable by two...and if so, run one style...if not, run the other. No separate stylesheet is needed, simply only two style classes. [/quote] great. but i tried that and it didnt work. maybe I need to place the stylesheet reference after the 'connect to database' commands on the page. any thoughts.? thanks
  5. Is there any way of changing the way a MySQL record is displayed (using css) depending on its row $id ? i tried to add the stylesheet href ($style) to each row in the databasese and incorporate that in the pages header : <link rel="stylesheet" type="text/css" href="../assets/<?php echo "$style" ?id=$id" ?>"> I'm thinking this didnt work for loads of resons. I'm no expert as you might have gathered. ..so just to clarify, I need my dynamic form to display the data differently, depending on the row id / session id . Any suggestions Tim
  6. Is there any way of changing the way a MySQL record is displayed (using css) depending on its row $id ? i tried to add the stylesheet href ($style) to each row in the databasese and incorporate that in the pages header : <link rel="stylesheet" type="text/css" href="../assets/<?php echo "$style" ?id=$id" ?>"> I'm thinking this didnt work for loads of resons. I'm no expert as you might have gathered. ..so just to clarify, I need my dynamic form to display the data differently, depending on the row id / session id . Any suggestions Tim
×
×
  • 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.