lewis987 Posted June 23, 2007 Share Posted June 23, 2007 well, i want PHP to query a table to get the theme that the use has set, then query another database to get the path of the theme so like this Q1=get theme from user settings table Q2=Get theme Path from theme table Here is my code: //SELECT CORRECT THEME if($user){ $themesql2=mysql_query("SELECT * FROM `$settings` WHERE `user` = '$user'"); $themerows2=mysql_fetch_array($themesql2); $theme=$themerow['theme']; $themesql1="SELECT * FROM `drw_themes` WHERE `name` = '$theme'"; $themeresult1=mysql_query($themesql1); $themerows1=mysql_fetch_array($themeresult1); $path2=$themerows1['path']; echo $themesql1; ?> <link href="<?PHP echo $path2; ?>style.css" rel="stylesheet" type="text/css" /> <?PHP } else { $defaultsql=mysql_query("SELECT * FROM $themes WHERE `name`='default'"); $defaultrows=mysql_fetch_array($defaultsql); $path1=$defaultrows['path']; ?> <link href="<?PHP echo $path1; ?>style.css" rel="stylesheet" type="text/css" /> <?PHP } Quote Link to comment https://forums.phpfreaks.com/topic/56833-solved-php-doesnt-seem-to-work-on-this-script/ Share on other sites More sharing options...
AndyB Posted June 23, 2007 Share Posted June 23, 2007 You don't actually state a problem. Perhaps $themerows2=mysql_fetch_array($themesql2); $theme=$themerow['theme']; Should be $themerows2=mysql_fetch_array($themesql2); $theme=$themerows2['theme'];// edited version Quote Link to comment https://forums.phpfreaks.com/topic/56833-solved-php-doesnt-seem-to-work-on-this-script/#findComment-280822 Share on other sites More sharing options...
lewis987 Posted June 23, 2007 Author Share Posted June 23, 2007 ok, that didnt work either but i found the error. Quote Link to comment https://forums.phpfreaks.com/topic/56833-solved-php-doesnt-seem-to-work-on-this-script/#findComment-280847 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.