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 mysql
//this works fine <?php phpinfo(); ?> //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); ?> From: Donatas Vyzas [mailto:donatas@xxxxxxxxxxxxxxx] Hi, Hi, If I want to use MySQL with PHP do
I need to re-compile PHP or can I just adjust the php.ini file to use
MySQL? Thanks in advance. Bob |
- Follow-Ups:
- Re: Using MySQL with PHP
- From: Donatas Vyzas
- Re: Using MySQL with PHP
- Prev by Date: Re: Using MySQL with PHP
- Next by Date: Re: Using MySQL with PHP
- Previous by thread: Re: Using MySQL with PHP
- Next by thread: Re: Using MySQL with PHP
- Index(es):