Jump to content

How to make the whole MySql table as variable?


scepanmali

Recommended Posts

No, I didn't explain it well! I have 5 tables and I want to make variables so I can use it later for $_GET function! You know, like, if someone clicks on 1st table, I want to extract only results from that table.

Tables are: metal, rock, pop, hip_hop, domaca. I have 5 scripts with these tables and I want to make variable to unite this 5 tables into one variable "$table"

 

Here is one of the scripts:

<?php

 

$dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
echo "<br>";
$selected = mysql_select_db("spotovi1", $dbhandle) or die("Could not select DB");

$row['Artist']=$Artist;
$row['Song']=$Song;
$id= $row['id'];
$row['id']= $id;
$id = $_GET['id'];
$Artist = $_GET['Artist'];
$Song = $_GET['Song'];

$sql = mysql_query("SELECT * FROM oblast_metal WHERE ID = '$id'"); #variable from this!!!

while ($row = mysql_fetch_array($sql)) { ?>

<?php $zajedno=$row['Artist']."- ".$row['Song'];

echo "<font size=3><font color=white><b>Download </b></a> </font></font>";

echo "<font size=4><font color='#A49F8B'><a href=\"{$row['Link']}\"><font color='#A49F8B'>$zajedno</font></font></a>";
echo "<font size=3><font color=white><b> Music Video</b> </a> </font></font>";
}
php?> 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.