Results 1 to 10 of 12

Thread: Day 13 - MySQL - Become PHP Expert in 30 days

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    DAY 13 PHP PROGRAMMING

    http://php.flashwebhost.com/tom/day_13_mysql_read.php

    PHP Code:

    <?php
    $db_server 
    '127.0.0.1';$db_user 'fwhphp_user';$db_password 'k5BJRaX6SFbs';$db_name 'fwhphp_db';
    $mysqli = new mysqli($db_server$db_user$db_password$db_name);
    if (
    $mysqli->connect_errno) {
    echo 
    'connect failed: ' $mysqli->connect_error;exit();}
    $sql 'SELECT * FROM `chat`';$result $mysqli->query($sql);echo '<p>MySql have returned ' $result->num_rows ' records</p>';
    echo 
    '<br>';echo '<hr>';
    while (
    $chat $result->fetch_object()) {
    echo 
    '<b><i>'$chat->name '</i></b> says: ' $chat->message ;
    echo 
    '</br>';echo '</hr>';
    }

  2. #2
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Good, working perfectly. If you don't understand any part, ask here. Some times it take some time to understand stuff properly, so you can skip forward, you can come back later as required. When we have done more code like this, you will get a much better idea and things may get easier.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

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
  •