Donatas, That was it. Thanks so much. Bob From: Donatas Vyzas [mailto:donatas@xxxxxxxxxxxxxxx] Take a look at the line: When running the phpinfo() I get
this below for the mysql section. I copied the libmysql.dll to the
windows directory as some of the instructions had said. This is the
library that is lets php talk to mysql. I am running php 5, mysql 5, and
apache 1.3. I am successfully using mysql with the administrator and
workbench modules of mysql. I am trying to perform a db connection from one of the on-line
tutorials and I can’t get a db connection. See my code below
//this does not work <?php // Connecting, selecting database echo 'Trying to
Connect...';
//last line executed $link = mysql_connect('flms', 'userid',
'password') //appears to stop here or die('Could not connect: '
. mysql_error()); echo 'Connected successfully'; mysql_select_db('flms') or die('Could not
select database'); // Performing SQL query $query = 'SELECT * FROM allow'; $result = mysql_query($query) or die('Query
failed: ' . mysql_error()); // Printing results in HTML echo "<table>\n"; while ($line = mysql_fetch_array($result,
MYSQL_ASSOC)) { echo
"\t<tr>\n"; foreach ($line as $col_value)
{ echo
"\t\t<td>$col_value</td>\n"; } echo "\t</tr>\n"; } echo "</table>\n"; // Free resultset mysql_free_result($result); // Closing connection mysql_close($link); ?> |
- Prev by Date: Re: Using MySQL with PHP
- Next by Date: configure: error: mysql_query missing!?
- Previous by thread: Re: Using MySQL with PHP
- Next by thread: configure: error: mysql_query missing!?
- Index(es):