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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| ||||
| >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. |