camc Posted December 15, 2008 Share Posted December 15, 2008 hi sry my english database tablename>params_field(TEXT) values: menu_image=-1 pageclass_sfx=ssss print= back_button= name=1 position=1 email=0 $row=mysql_fetch_array $myparam1 = $row['']['pageclass_sfx=']; how do this action. plz help me. this class use in joomla mosParameters class. Quote Link to comment https://forums.phpfreaks.com/topic/137071-php-mysql-parameter-load/ Share on other sites More sharing options...
Adam Posted December 15, 2008 Share Posted December 15, 2008 Couldn't work out what your table name was.. <?php $query = mysql_query("SELECT * FROM tablename"); while ($row = mysql_fetch_array($query)) { $myparam1 = $row['pageclass_sfx']; // do whatever else } ?> That's the basics of it.. In that example though for each record returned it would overwrite the $myparam1 variable. A Quote Link to comment https://forums.phpfreaks.com/topic/137071-php-mysql-parameter-load/#findComment-715895 Share on other sites More sharing options...
camc Posted December 15, 2008 Author Share Posted December 15, 2008 //* params field value: param1=page param2=menu param3=content */ mysql_connect('localhost', 'root', 'root'); mysql_select_db('testparams'); $qry = "SELECT params FROM params"; $act = mysql_query($qry); $row = mysql_fetch_array($act); $params = $row['params']; $salga = explode("\n", $params); $char = '$'; $var = $char.$salga['0']; if($var=='page') { echo 'ok'; // not work } Quote Link to comment https://forums.phpfreaks.com/topic/137071-php-mysql-parameter-load/#findComment-715918 Share on other sites More sharing options...
camc Posted December 15, 2008 Author Share Posted December 15, 2008 plz help me Quote Link to comment https://forums.phpfreaks.com/topic/137071-php-mysql-parameter-load/#findComment-716077 Share on other sites More sharing options...
camc Posted December 16, 2008 Author Share Posted December 16, 2008 DING ALL. ??? Quote Link to comment https://forums.phpfreaks.com/topic/137071-php-mysql-parameter-load/#findComment-716716 Share on other sites More sharing options...
priti Posted December 16, 2008 Share Posted December 16, 2008 if not wrong in joomla you cann't do this mysql_connect('localhost', 'root', 'root'); mysql_select_db('testparams'); you have to use DB class method to access what you are trying might be mosParam() i tweak years back !! Quote Link to comment https://forums.phpfreaks.com/topic/137071-php-mysql-parameter-load/#findComment-716726 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.