Re: database querying form in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx> wrote in message 
news:20050413153215.74622.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux