If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > connection to mysql - i want to cry

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-04, 08:25
fugu3 fugu3 is offline
Registered User
 
Join Date: May 2004
Posts: 2
Unhappy connection to mysql - i want to cry

hello, im a newbie, i have a snipit of code which "should" let me view the contents of a selected table in my database.

i uploaded and when i viewed, i got nothing but a blank page!!!

can anyone help me, or does anyone know an easier way to create a register / login databse so people can gain access ect...
please help, im losing my hair.

<?php
// connect to the database

$connection = mysql_connect("local host","mysqlUserName,"MysqlPassWord");

// choose database
$db = mysql_select_db("test", $connection);

$SQL = "SELECT url FROM site01_favwebsites";

$websitesURLs = mysql_query($SQL);
?>

<table border="1">
<?php
for ($i = 1; $i <= $numRows; $i++)
{

// get results

$rowOfResults = mysql_fetch_array ($websiteurls);
?>
<tr>
<td><?php echo $rowOfResults['url'] ?></td>
<tr>
<?php
}
?>
</table>
Reply With Quote
  #2 (permalink)  
Old 05-13-04, 18:14
archspeed archspeed is offline
Registered User
 
Join Date: May 2004
Location: Northern California
Posts: 10
Oh boy, I'm about to have to do a project like this soon (PhP/MySQL with login access). More opportunities to learn new stuffs.
__________________
Tuan M. -- Database Developer Newbie, dot NET generation
If you want cheap-shit web hosting, check out www.websaic.com
For all your custom test socket needs, check out Gold Technologies, Inc.
Oh yeah, last but not least, GO BAR-Honda!
Reply With Quote
  #3 (permalink)  
Old 05-13-04, 23:37
sstodvictory sstodvictory is offline
Registered User
 
Join Date: Mar 2004
Location: Illinois
Posts: 5
I don't know if the code is correct or not, but you're missing the closing double quote on mysqlUserName.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On