hi sry my english
//* 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
}
php mysql parameter load
Moderator: General Moderators
-
cavemaneca
- Forum Commoner
- Posts: 59
- Joined: Sat Dec 13, 2008 2:16 am
Re: php mysql parameter load
I'm not sure exactly what you want, but I'm guessing it just doesn't work, so I'll fix what I can tell is wrong.
This should at least get you started.
If this doesn't help, please explain what you are trying to do, and what is wrong. And do this every time you post a problem. If your English isn't good enough, use an online translator and post that here. At least you'll have all the words you need to express your problems.
Code: Select all
//* params field value:
param1=page
param2=menu
param3=content
*/
mysql_connect('localhost', 'root', 'root');
mysql_select_db('testparams');
$qry = "SELECT * FROM params";
$act = mysql_query($qry);
while($row = mysql_fetch_array($act);){
$params = $row;
$salga = explode("\n", $params);
$char = '$';
$var = $char.$salga['0'];
echo $var; // shows what is output
if($var=='page') {
echo 'ok';
}
}
else {
echo 'not working';If this doesn't help, please explain what you are trying to do, and what is wrong. And do this every time you post a problem. If your English isn't good enough, use an online translator and post that here. At least you'll have all the words you need to express your problems.