0

<?php
include ('main_config.php');
//get all web settings
$web_settings = array();

<?php
include ('main_config.php');
//get all web settings
$web_settings = array();
try {
    $db = new PDO($mysql_host_db, $mysql_user, $mysql_pass);
    $query = "SELECT * FROM t_lfs_web_settings"; 
    //$result = $db->query($query);
    $result = $db->prepare($query);
    $result->execute();
     foreach($result as $row)
        {
        echo $row['gld'].'<br />';
        echo $row['gname'].'<br />';
        echo $row['gvalue'];
        }



$db = new PDO($mysql_host_db, $mysql_user, $mysql_pass);
$query = "SELECT * FROM t_lfs_web_settings"; 
//$result = $db->query($query);
$result = $db->prepare($query);
$result->execute();
 foreach($result as $row)
    {
    echo $row['gld'].'<br />';
    echo $row['gname'].'<br />';
    echo $row['gvalue'];
    }

here gld,gname,gvalue are the field names of table. But I get error message while trying to display.

2
Contributors
1
Reply
6
Views
2 Years
Discussion Span
Last Post by minitauros
0

What is the error that you're getting?

You could try to add print_r($row); inside your loop so that you can see the contents of $row and see if anything is missing.

Edited by minitauros

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.