Technology, Web & Business Forum

You are here: Technology, Web & Business Forum : Web Development : Programming : Simple PHP / MySQL not working! Argh!


Welcome to the Technology, Web & Business Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.


Programming Discuss programming languages such as .NET, PHP, PERL, ASP, ColdFusion, C++


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2009
Junior Member
 
Join Date: Jun 2009
Posts: 3
Default Simple PHP / MySQL not working! Argh!

The problem I am having is that when I visit this page (memberlist.php if you were wondering), it is blank, no HTML, nothing.

OK, fair enough, at the moment, there's nothing in the DB, so it shouldn't be displaying rows and rows of information. But, it should still display the titles of the columns (because there's no 'if' or 'where', just 'echo')

PHP Code:
 <?php

$con 
mysql_connect("localhost""username""password");
if (!
$con)
  {
  die(
'Could not connect: ' mysql_error());
  }

mysql_select_db("database_name"$con);

$result mysql_query("SELECT * FROM tablename ORDER BY joined, name");

echo 
'<table width="100%" border="0">
  <tr>
    <td>#</td>
    <td>Name</td>
    <td>Role</td>
    <td>Joined</td>
    <td>GB Profile</td>
  </tr>'
;

while(
$row mysql_fetch_array($result))
    {
    echo 
"<table>
        <tr>
            <td>
$row['id']</td>
            <td>
$row['name']</td>
            <td>
$row['role']</td>
            <td>
$row['joined']</td>
            <td>
$row['gb']</td>
        </tr>
    </table>"
;
        
    echo 
"<br />";
    }
  
mysql_close($con);

?>
Reply With Quote
  #2 (permalink)  
Old 07-10-2009
Junior Member
 
Join Date: Jul 2009
Posts: 3
Default hello

There is error in your coding .you can contact for solve this coding
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 07:01 PM.