Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

[RESOLVED] MySQL & Php

  • 11-05-2005 12: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