SQL Selecting tables from DB

How do you mean?

Im using SQLYog (A GUI programme that lets you manage the database) the SQL Database itself is located on the SQL server of my web-hosting company.
 
How do i find out what type of database im running on? as i said its running on the web-host i am using and im using a 3rd party package (GUI) that lets me manage the database, then i use PHP as a web-front end to run the SQL query's

Code:
<?
$username="";
$password="";
$database="";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SHOW TABLES";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

echo  "<b><center>Database Output</center></b><br><br>";




$i=0;
while ($i < $num) {

$catagory=mysql_result($result,$i,"catagory");
$title=mysql_result($result,$i,"title");
$price=mysql_result($result,$i,"price");











$i++;
}

?>


how would i change

$catagory=mysql_result($result,$i,"catagory");
$title=mysql_result($result,$i,"title");
$price=mysql_result($result,$i,"price");

to hold the output for the table information? because it dont contain any fields? its just the table names?
 
Last edited:
Ok, iv managed to pull the table names from the database and iv worked out how to change them to links with abit of help from beansprout.


www.caldicot-pc-helpdesk.co.uk/fcv/database/index3.php

by using the following code

Code:
while($row = mysql_fetch_row($result))
{
echo '<a href="index8.htm">'.$row[0].'</a>';

echo "<br />";
}

I want to be able to click this link which is located in 1 div, and the table contents (when clicked) will appear in another div.

What will i have to do to get this? i cant remember the code for targeting a link to another part of the page.
 
Back
Top Bottom