Jump to content

php mysql parameter load


camc

Recommended Posts

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

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

//* 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 :D

}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.