Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

newbie PHP/SQL problem
Hi All,
I've install a supposedly compatible combination of PHP, SQL with an
Apache server. Generally all individual components seem to operate fine. I
can create tables in the database using mysql and I can run basic PHP code
in my browser using the apache server. Everything's running on my desktop
PC.

However,  whenever I use the mySQL related functions in my PHP, the php
script just stops. No error messages. Just nothing. For example, using
something like:

$conn = mysql_connect("localhost", "root", "")  or die(mysql_error());

in my php just stops the script dead. Everything up to this line executes
but nothing after it. This appears to be the same behaviour as if I put in a
non-existant function call. So my question is, how does the php know where
to find the SQL functions?. Is there any configuration required?. All of my
components came out of a book (with CD) and have been configured as
suggested.

Any ideas?.

Ta,
Dave



Report this thread to moderator Post Follow-up to this message
Old Post
Dave Moore
04-18-05 01:55 AM


Re: newbie PHP/SQL problem
"Dave Moore" <dave_m_moore@post2me.freeserve.co.uk> kirjoitti
viestissä:d3ufje$elj$1@newsg3.svr.pol.co.uk...
> Hi All,
>    I've install a supposedly compatible combination of PHP, SQL with an
> apache server. Generally all individual components seem to operate fine. I
> can create tables in the database using mysql and I can run basic PHP code
> in my browser using the apache server. Everything's running on my desktop
> PC.
>
> However,  whenever I use the mySQL related functions in my PHP, the php
> script just stops. No error messages. Just nothing. For example, using
> something like:
>
> $conn = mysql_connect("localhost", "root", "")  or die(mysql_error());
>
> in my php just stops the script dead. Everything up to this line executes
> but nothing after it. This appears to be the same behaviour as if I put in
> a
> non-existant function call. So my question is, how does the php know where
> to find the SQL functions?. Is there any configuration required?. All of
> my
> components came out of a book (with CD) and have been configured as
> suggested.
>
> Any ideas?.
>

Would you normally get errormessages for any other kind of errors. Also:
there's a function function_exists, which tests if a function exsists. Try
something like
if(function_exists("mysql_connect")) echo "It's alive! Aliiiive!";
And then see what phpinfo(); prints about mysql. That might give you some
answers what's going on in there.

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

eternal.erectionN0@5P4Mgmail.com



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-18-05 01:55 AM


Re: newbie PHP/SQL problem
if it's a non-existant function call, add C:\PHP to your PATH, or put
libmysql.dll (mysql < 4.1) or libmysqli.dll (mysql >= 4.1) into
c:\windows\system32 (if you're on windows. if you're on linux, that's not my
area.)

"Dave Moore" <dave_m_moore@post2me.freeserve.co.uk> wrote in message
news:d3ufje$elj$1@newsg3.svr.pol.co.uk...
> Hi All,
>    I've install a supposedly compatible combination of PHP, SQL with an
> apache server. Generally all individual components seem to operate fine. I
> can create tables in the database using mysql and I can run basic PHP code
> in my browser using the apache server. Everything's running on my desktop
> PC.
>
> However,  whenever I use the mySQL related functions in my PHP, the php
> script just stops. No error messages. Just nothing. For example, using
> something like:
>
> $conn = mysql_connect("localhost", "root", "")  or die(mysql_error());
>
> in my php just stops the script dead. Everything up to this line executes
> but nothing after it. This appears to be the same behaviour as if I put in
> a
> non-existant function call. So my question is, how does the php know where
> to find the SQL functions?. Is there any configuration required?. All of
> my
> components came out of a book (with CD) and have been configured as
> suggested.
>
> Any ideas?.
>
> Ta,
> Dave
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Michael Bradley-Robbins
04-18-05 08:56 AM


Re: newbie PHP/SQL problem
Dave Moore wrote:
> Hi All,
>     I've install a supposedly compatible combination of PHP, SQL with an
> apache server.

Which one?

I would suggest downloading XAMPP. Pretty much the best PHP/MySQL
package available. Includes PHP switcher, to switch from PHP 4.x to 5.x
on-the-fly.

http://www.apachefriends.org/en/xampp.html

> However,  whenever I use the mySQL related functions in my PHP, the php
> script just stops. No error messages. Just nothing. For example, using
> something like:
>
> $conn = mysql_connect("localhost", "root", "")  or die(mysql_error());
>
> in my php just stops the script dead.

Open your PHP.INI and check if error_reporting is set correctly.

error_reporting  =  E_ALL & ~E_NOTICE

Set it like that and the die() command will spit out encountered errors,
which seems to be what you're looking for?

--
___|   ___|  _ \ _ _|  _ \__ __| __ \  |   | __ \  ____|
\___ \  |     |   |  |  |   |  |   |   | |   | |   | __|
| |     __ <   |  ___/   |   |   | |   | |   | |
_____/ \____|_| \_\___|_|     _|  ____/ \___/ ____/ _____|
Computers will never take the place of books. You can't stand on a
floppy disk to reach a high shelf.
I thought 'Deep Throat' was a movie about a giraffe :/



Report this thread to moderator Post Follow-up to this message
Old Post
Scriptdude
04-18-05 01:55 PM


Re: newbie PHP/SQL problem
No, that doesn't work either.

I've run up the database using winmysqladmin.exe, run up the server. I've
copied my libmysql.dll into windows and windows/system directories.

if(function_exists("mysql_connect"))
echo "It's alive! Aliiiive!";
else
echo "Can't find it";

fails. There's no mention of mysql in the phpinfo() output. It mentions
SQLite but nothing about MySQL. I assume it should?.

Any more ideas?.

Ta,
Dave


"Michael Bradley-Robbins" <michael@bradley-robbins.net> wrote in message
news:1165u8e3atdb174@corp.supernews.com...
> if it's a non-existant function call, add C:\PHP to your PATH, or put
> libmysql.dll (mysql < 4.1) or libmysqli.dll (mysql >= 4.1) into
> c:\windows\system32 (if you're on windows. if you're on linux, that's not
my
> area.)
>
> "Dave Moore" <dave_m_moore@post2me.freeserve.co.uk> wrote in message
> news:d3ufje$elj$1@newsg3.svr.pol.co.uk... 
I 
code 
desktop 
executes 
in 
where 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Dave Moore
04-19-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:20 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.