Morning everyone. Here at my job we figured out how to put import our sql queries into our MySql on our webhost. (hostgator.com). Now what i need to do is find a program or script that will take our Mysql databse and generate it into a webpage that our clients can go to and search the database. No photos, nothing crazy, just a database so when they search they will see the number of that particular item line we have in stock. Any suggestions? I am hoping that there is a small script or program, anything, that i can use for this. Please help, i have a deadline to meet by the end of the day and this is all new to me.. Its something that are hoping i can learn for them for future projects. Thank you!
if you customer know mysql query, then just create a html form with field database_name, user_name, password and the query. Then a php page to connect to database, run the query and display result
Ive got the PHP side down.. i am having trouble connecting, but that is somethign i will talk with out host provider later on about.. I am using in PHP: <?php $dbh=mysql_connect ("74.52.59.162", "ras_client", "<*****>") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("ras_test"); ?> Now what about the HTML part you are talking about.. how do i do that?
i am getting this message every time i try to connect.. wether i use localhost or the IP: Warning: mysql_connect(): Access denied for user 'ras_client'@'localhost' (using password: YES) in /home/ras/public_html/curtis/temptemp.php on line 8 I cannot connect to the database because: Access denied for user 'ras_client'@'localhost' (using password: YES)
ok, i believe you created the database and user ras_client, right? but did you grand the privilege to ras_client for the temptemp database?
yes. i granted permissions for ras_client to the ras_test database. Still nothing is working. Im sorry for being a noob at this. I am still learning.
We found the problem.. its because i had the password between these <****> .. Now the link works but its bringing up a blank page. Does anyone know how i get this page to show the database?
if you can wait till lunch time (around 12:30 est) i can help you with the displaying part. I am at work now
i will be here from now 11:30 EST to 1:00pm. Then i will be back at 2:est, and be here until 4:30. Your help is so arreciated, you have no idea! someone told me to use this on the php page to make the database show on the page... i put it in there, but its not working <?php $query = "SELECT * FROM table $result = mysql_query($query); //or die(mysql_error() . '<br>' . $sql); echo "<table>"; while($row = mysql_fetch_array($result)) { echo "<tr><td>$row[product id]</td><td>$row[quantity]</td></tr>"; } echo "</table>"; ?>
I think you need to mention the name of the table you want to "SELECT". Try this code: Replace the "Type your database table name here" with actual table name. Do not remove the "" marks. <?php $table= "Type your database table name here"; $query = "SELECT * FROM $table"; $result = mysql_query($query); //or die(mysql_error() . '<br>' . $sql); echo "<table>"; while($row = mysql_fetch_array($result)) { echo "<tr><td>$row[product id]</td><td>$row[quantity]</td></tr>"; } echo "</table>"; ?> That should display your entire database... Bye