can allow user select the column ?

i have a problem, how to allow user select the column, my list have over hundred rows items and over hundred columns for choose, how to show in the table only one of the (date) of user selected.

$searchid = $_POST['searchid'];

$date = $_POST['date'];

$query = "SELECT id, date FROM list WHERE id = '$searchid' AND $date = '$date'";

$result = mysqli_query($dbcon, $query) or die('error getting data');

echo "

echo "

while ($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){

echo "<tr><td>";
echo $row['id'];
echo "</td><td>";   
echo $row['product'];
echo "</td><td>";   
echo $row['**$date**']; 
echo "</td></tr>";
"; id product **$date** "; } echo " ";
more ▼

asked Dec 31, 2010 at 03:20 AM in Default

yflin89 gravatar image

1 1 1 1

If I understand correctly, you have a MySQL database, and your problem is to create and consume a result set against that database from PHP. You probably WILL get help from someone here, since people are helpful, but this site is intended for questions and answers about SQL Server, not about MySQL or PHP.
Dec 31, 2010 at 04:14 AM Magnus Ahlkvist
(comments are locked)
10|1200 characters needed characters left

0 answers: sort newest
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Dec 31, 2010 at 03:20 AM

Seen: 594 times

Last Updated: Dec 31, 2010 at 03:20 AM