Submit Your Article Forum Rules

Results 1 to 3 of 3

Thread: THe Data from MySQL can't show up at browser

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    3

    THe Data from MySQL can't show up at browser

    I have been learning for pHP in few days and
    I have problem. And the problem make me very confuse.
    I want to show some data from MySQL into my browser Internet Explorer 6.0. But it can't make it.
    The result is blank and dids't give me any message of my mistakes.
    All the syntax is correct but it can't happen as i want.
    This is the syntax.

    $sql = "SELECT id, firstname, lastname, spouse_firstname, housenumber, streetname, city, state, zip
    FROM $table_name ORDER BY lastname";
    $result = @mysql_query($sql, $connection) or die(mysql_error());
    $num = @mysql_num_rows($result);
    if ($num < 1) {
    $display_block = "

    Sorry! No results.</p>";
    } else {
    while ($row = mysql_fetch_array($result)) {
    $id = $row['id'];
    echo $id;

    $firstname = $row['firstname'];
    echo $firstname;

    $lastname = $row['lastname'];
    echo $lastname;

    $streetname = $row['streetname'];
    echo $streetname;

    $city = $row['city'];
    echo $city;

    $state = $row['state'];
    echo $state;

    $zip = $row['zip'];
    echo $zip;
    }

    Is there anything mistake at PHP 5.0 ? I use it.
    Anyone can help me? Please...

    mariocs

  2. #2
    Hi Mariocs

    I am new to but I see you need one more closing bracket and not sure but is the @ nessicessary in php5.0 I use 4.3

    Hope that helps
    Mike
    New SiteWhy Me Guy

  3. #3
    Senior Member Deep13's Avatar
    Join Date
    Dec 2003
    Posts
    302
    $result = @mysql_query($sql, $connection) or die(mysql_error());

    try this

    $result = @mysql_query($sql) or die(mysql_error());

    check this for syntax info...

    http://in2.php.net/mysql_query

    Regards
    Deep

Similar Threads

  1. show images from browser cache without sending http request
    By lohia_anirudh in forum IT Discussion Forum
    Replies: 3
    Last Post: 05-15-2007, 09:40 PM
  2. Show Me The Data
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 01-30-2006, 09:00 PM
  3. Getting MS Access data into MySQL database
    By Dragonsi in forum Database Discussion Forum
    Replies: 1
    Last Post: 04-06-2005, 12:52 AM
  4. Transfer data from Access to MySQL via PHP?
    By DarrenPWS in forum Database Discussion Forum
    Replies: 2
    Last Post: 02-11-2005, 06:36 AM
  5. Data Dump: Excel -> mySQL
    By WildSeeker in forum Database Discussion Forum
    Replies: 2
    Last Post: 09-24-2004, 01:52 PM

Posting Permissions

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