[Resolved] SQL Script output results into table

Home Forums Support SQL Script output results into table

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #86651
    Craig Nicholson

    Hi all

    I have been trying for 2 days now after google searching forums and feel this is the best place to put my problem that hopefully someone can help me with

    i am trying to write an sql script to query my database and get the results into a table.

    but it doesn’t seem to work

    the table headings appear but everything from the first <?php tag shows on the screen

    this is my script

    <title>Last 10 Results</title>
    <td>Property Image</td>
    <td>Property Description</td>
    $connect = mysqli_connect(“db567706584.db.1and1.com”, “dbo567706584”, “<i would put password here>”, “db567706584”);
    if (!$connect) {
    $results = mysql_query(“SELECT Property Title4HTML,Image Tag FROM Properties,Available WHERE Property Available Flag = Flag AND Property Available Flag = ‘2’”);
    while($row = mysql_fetch_array($results)) {
    <td><?php echo $row[‘Property Image’]?></td>
    <td><?php echo $row[‘Property Description’]?></td>
    <td><?php echo $row[‘Availability’]?></td>


    does any one know why my results are not coming back?

    thanks for any help

    Craig Nicholson

    also to note i have placed this code in the GP Hooks section under wp_head

    $host_name = “db567706584.db.1and1.com”;
    $database = “db567706584”;
    $user_name = “dbo567706584”;
    $password = “<the password>”;

    $connect = mysqli_connect($host_name, $user_name, $password, $database);
    if (mysqli_connect_errno())
    echo “Failed to connect to MySQL: ” . mysqli_connect_error();

    Lead Developer
    Lead Developer

    Hmm, I’m not a big MySQL guy, but you should try posting over at stackoverflow: http://stackoverflow.com/

    It’s the best place for code questions and you should have someone answer you pretty quickly.

    Sorry I can’t be more helpful!

    Craig Nicholson
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.