SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict isuru's Avatar
    Join Date
    Nov 2000
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can you do the following command using echo:

    printf("First Name: %s <br>\n", mysql_result($result, 0, "first");

    I tried doing:

    echo("First Name: mysql_result($result, 0, 'first') <br>\n");

    but it didn't work.

    I dont really like the look of prints (it seems too complicated) so Im trying to do it in echo.

    Thanks in advance.

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:
    echo("First Name:". mysql_result($result, 0, 'first')." <br>\n");

    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Zealot
    Join Date
    Nov 1999
    Location
    Manhattan!
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Assuming $result holds the result from a sql query

    <?

    $data = mysql_fetch_array($result);

    echo "First Name: " . $data['first'] . "<br>";
    echo "Last Name: " . $data['last']] . "<br>";
    // etc. etc.

    ?>

    Christian
    www.Christian.Reimer.com
    A personal website exploring the mental summersaults,
    odd occurrences and political powerplays in the land of me.


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
  •