Unix Technical Forum

Most basic php/mysql test?

This is a discussion on Most basic php/mysql test? within the MySQL forums, part of the Database Server Software category; --> Hi I need to check if php/sql is working correctly. Is there a standard test code for this or ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:27 AM
Mike
 
Posts: n/a
Default Most basic php/mysql test?

Hi

I need to check if php/sql is working correctly.

Is there a standard test code for this or what is the simplest query i can
write to do this?


Would something as simple as this work and display all the info from a
database?.

<php>
select * from database database1
</php>

How would i then link to the mysql connection details?, something like?:

<?
$conn=mysql_connect('localhost', 'test', 'test');
?>


tia


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:27 AM
Gordon Burditt
 
Posts: n/a
Default Re: Most basic php/mysql test?

>I need to check if php/sql is working correctly.
>
>Is there a standard test code for this or what is the simplest query i can
>write to do this?


SELECT 2+2;

Hint: the result should be 4.

>Would something as simple as this work and display all the info from a
>database?.
>
><php>
>select * from database database1
></php>


No. You can do that for a table (which you need to be sure exists
first), not a whole database.

>How would i then link to the mysql connection details?, something like?:
>
><?
>$conn=mysql_connect('localhost', 'test', 'test');
>?>


You need to ASK THE ADMINISTRATOR. However, initial guesses of
host: localhost, database: test, username: root (not sure if this
is the default on Windows systems), password: none are not too bad
for initial installs. The test database will probably not have any
tables in it, though.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:10 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com