SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot Emma's Avatar
    Join Date
    Sep 2004
    Location
    atlanta
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problems Displaying Content from Database

    I've been starring at this code for awhile and I can't find where I am going wrong. Without this code, the page displays perfectly, with this code I just get a blank page... no error code or anything. I'm sure it's something stupid I'm overlooking but for the life of me I can't find it. Any help would be extremely appreciated! Thanks!


    PHP Code:

    <?php 

    // Address error handing.
    ini_set ('display_errors'1);
    error_reporting (E_ALL & ~E_NOTICE);

    // Connect and select.
    require_once ('admin/connections/connect.php');

        
    // Define the query.
    $query 'SELECT * FROM admin_projectofthemonth Where project_id="1";
        
    if ($r = mysql_query ($query)) { // Run the query.

        // Retrieve and print every record.
        while ($row = mysql_fetch_array ($r)) {
            print "<p><b>Project Name:</b> {$row['
    project_name']}<br>
                    <b>Contact:</b> {$row['
    project_contact']}<br>
                    <b>Location:</b> {$row['
    project_location']}<br>
    <b>Sales Rep:</b> {$row['
    project_salesrep']}<br>
    <b>Email:</b> <a href=\"mailto:{$row['
    project_email']}\">{$row['project_email']}</a><br>
    <b>Description:</b> {$row['
    project_description']}<br>
    <b>Customer Comments:</b> {$row['
    project_customercomments']}<br>

            </p><hr>\n";
        }

    } else { // Query didn'
    t run.
        die (
    '<p>Could create the table because: <b>' mysql_error() . "</b>. The query was $query.</p>");
    // End of query IF.


    ?>

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The syntax highlighting gives it away:

    $query = 'SELECT * FROM admin_projectofthemonth Where project_id="1";

    should be:

    $query = 'SELECT * FROM admin_projectofthemonth WHERE project_id=1';

  3. #3
    SitePoint Zealot Emma's Avatar
    Join Date
    Sep 2004
    Location
    atlanta
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah. stupid on my part. Thank you!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •