Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mysql PHP 5.0 a question

Status
Not open for further replies.

fleart1

Technical User
Jun 6, 2004
24
US
Hi,
this is simialr to the question below except I am not sure how to tell if my files are compiled. I followed directions exactly: it says to enable php_mysql.dll inside of php.ini so I went to php.ini an deleted the ; in front of php_mysql.dll that was under heading Windows extensions. Next I copied the libmysql.cll to the win system folder and system 32 to make sure
Lastly It said By using the --with-mysql[=DIR] configuration option you enable PHP to access MySQL databases.
I went to compile again like instructions said For compiling, simply use --with-mysql=[DIR] where [DIR] points to your MySQL installation directory.

I typed --with-mysq;=[C:\wamps]; because mysql folder is directly under wamps but I got error does not recoginze the command?
when I try my index.php I get this error
Fatal error: Call to undefined function mysql_connect() in c:\wamp\ on line 7
can anybody tell me what command to use with with or something else tho help.
thanks
 
The instruction:

By using the --with-mysql[=DIR] configuration option you enable PHP to access MySQL databases.

only applies when you are compiling the software from source "configuration option" is an input to a script called "configure" which sets up compile options.

And I'll bet you're not compiling the software on Win32.

Look in your binary distribution for a file called "php_mysql.dll". If you have it, look for an "extension" directive in php.ini and uncomment it. If php_mysql.dll resided in the correct directory, you should be good to go.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
HI,
That is exactly what i just did again, the file was in binaries. I removed the ; from infront of the extension=php_mssql.dll which was under the windows extension heading in the php.ini, same as above and got same error
 
The php_mssql.dll extension library has nothing whatsoever to do with MySQL. That library is for MS SQL (Mi[¢]ro$oft SQL Server).

You need to use php_[red]mysql[/red].dll



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
that is the only place in the php.ini that has php_mysql.dll. It cant be found anyplace else
 
fleart1 said:
I removed the ; from infront of the extension=php_[red]mssql[/red].dll


I'm trying to verify that you're trying to use the appropriate extension library, as you will not be able to use the MySQL library to communicate with SQL Server or vice versa.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
ok, so I am then correct? Her is the entire extension library from the ini
;Windows Extensions
;Note that ODBC support is built in, so no dll is needed for it.
;

;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
 
It looks as though you have the correct library extension activated.

The problem will be putting the library file where PHP finds it. I'm more familiar with PHP on unix-like OSes, so I'm just guessing here, but I'd try {win32 install}, {win32 install}\system32, and the directory in which PHP was installed.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I copied the libmysql.cll to the wamp folder too
wamp/php/bin is the path. I also have it under windows/system and windows/system32 folders. I didnt have a win32/install folder.
 
Sorry, I wasn't clear.

"{w32 install}" is the Windows install directory. On W2k and WinNT, the default is "C:\winnt". On WinXP, it's "c:\windows"


How are you running PHP, as a CGI or as a web server module? If it's the latter, PHP will only read php.ini when the web server starts. This may also be true of PHP when run as a CGI on Win32.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I went into my c drive. there is only windows/systems and systems. There isnt a winnt, the folder is not under c drive and does not exist? I looked in ini and didnt find anything o ninstall either
 
HI,
ther isnt a c:winnt directory on my computer and I am win2K. Also, I went into ini and ant find anyting on install there either
 
I thought you said tht the library should be in the install file. That is why I just said there isnt any install folder to put it in. I am running as a win module. To make sure I wasnt misunderstanding you I inmserted the libmystl into windows folder and now get theses group of errors.

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\wamp\ on line 7
First Name:

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\wamp\ on line 8
Last Name:

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\wamp\ on line 9
Address:

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\wamp\ on line 10
Position:
 
HI again,under my logo ther were a couple more errors when it opened. below


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\wamp\ on line 83

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\wamp\ on line 92
 
The "not a valid MySQL result resource" is because your mysql_query() invocation did not, well, return a valid MySQL result resource.

When you invoke mysql_query(), many things can be returned, based on whether the query was successful and what kind of query was issued. Generally, you will get a MySQL result resource from mysql_query() if the query was successful and if the query would return data. A DELETE query, if successful, would cause mysql_query() to return simply boolean TRUE. See for more information, paying particular attention to the example code on that page which shows how to test the return and get more information if the query fails.


Want the best answers? [url=http://www.catb.org/~esr/faqs/smart-questions.html]Ask the best questions!


TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top