Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

[RESOLVED] MySQL & Php

  • 11-05-2005 01:44PM
    #1
    Closed Accounts Posts: 538 ✭✭✭


    Hi. I'm trying to display data stored in my database on my webpage. I'm really new to PHP & MySQL so I can't figure this out.

    Here's the code:
    [PHP]<?
    mysql_connect('www.myserver.ie','username','password') or die(mysql_error());
    mysql_select_db('database_name');
    $query = mysql_query('SELECT * FROM Table_Name ORDER BY column_name ASC') or die('There was another fecking error!');

    while( $row = mysql_fetch_array ( $query ) ) {
    echo $row[‘Row_Name’].’ this is one of the columns.<br>’;
    }
    echo ‘Finished!’;
    ?>[/PHP]


    When I open the page in my browser I get this error:

    Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /hsphere/local/home/username/domain.ie/secure/index_new.php on line 15

    This is line 15: echo $row[‘Prj’].’ this is one of the columns.<br>’;


    Any idea what I am doing wrong?


    I'm trying to follow this tutorial: BioRust Tutorial
    But obviously I haven't got a clue ;)


    Thanks. :confused:


    .


Comments

  • Closed Accounts Posts: 36 Caixa


    Try copying and pasting this in place of the relevant line above:

    [php]
    echo $row.' this is one of the columns.<br>';
    [/php]


  • Closed Accounts Posts: 538 ✭✭✭exactiv


    Excellent. Thanks. it worked a treat. :)


Advertisement