Reply to Re: database querying form in php

Your name:

Reply:


Posted by Satyam on 10/18/41 11:13

The following used to work, though I haven't used it for a while. Please be
carefull of who are you letting do what. A little checking, for example,
only 'select' statements with no semi-colons or any other trick to modify
the database might be good. Assumes there is a style sheet with a class
'Listado' somewhere.

Satyam



$result = mysql_query($_REQUEST['Query']) or die("Query failed : " .
mysql_error());
echo "<p>" . $_REQUEST['Query'] . "</p>";
/* Printing results in HTML */

echo "<div class=listado><table>\n";

echo "\t<tr>\n";

for ($i=0;$i < mysql_num_fields($result);$i++) {
echo "\t\t<th>" . mysql_field_name($result,$i) . "</th>\n" ;
}

echo "\t</tr>\n";

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table></div>\n";

/* Free resultset */
mysql_free_result($result);

"Babu" <garavindbabu@yahoo.co.uk> wrote in message
news:20050413153215.74622.qmail@web25007.mail.ukl.yahoo.com...
> HI,
>
> I ilke to create user interface for a group of people for entering the
> queries and to see the results in a browser. The users have the knowledge
> of database.
> for example: the users will have a login check, and if successful they
> will see a window where they can enter the sql queries and can see the
> results.I also want to implement a history of queries where the user can
> use it when ever needed.
> i have done the user authentication part. But i do not get an idea how the
> User interface can be?
> I have seen PhpMyadmin.its nice , but lillte bit complex for me as i also
> need some code to know how it implemented.
> can some one please point to some examples or so.
>
> Thanks
> babu
>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация