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. 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 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 } 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 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. ??? 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 !! Link to comment https://forums.phpfreaks.com/topic/137071-php-mysql-parameter-load/#findComment-716726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.