If (get_magic_quotes_gpc () = 1 ){
?>
<Html>
<Head> <title> MySQL (the best combination with PHP) Universal Query Program </title> <Body>
Note that the configuration file php (as the mainstream development language) (php (as the mainstream development language) 3 is php (as the mainstream development language) 3.ini, php (as the mainstream development language) 4 is php (as the mainstream development language ). magic_quotes_gpc in ini)
Set it to Off or 0. After modification, restart apache (the most popular WEB server platform on Unix ).
</Body>
</Html>
<?
Exit ();
}
Set_magic_quotes_runtime (0 );
$ Host = localhost;
$ Db = test;
$ User = test;
$ Pass =;
// [Php (as the mainstream development language)/inc/str2url. php (as the mainstream development language)] cvs 1.2
Function str2url ($ path ){
Return eregi_replace ("/", "/", urlencode ($ path ));
}
?>
<Html>
<Head> <title> MySQL (the best combination with PHP) Universal Query Program </title> <Body>
<Form action = "<? Echo str2url ($ php (as the mainstream development language) _ SELF);?> "Method =" post ">
Enter the SQL statement: <br>
<Textarea name = "SQL" cols = "100" rows = "5"> <? Echo $ SQL;?> </Textarea> <br>
<Input type = "submit" name = "cmd" value = "query">
<Input type = "submit" name = "cmd" value = "">
</Form>
<?
If ($ cmd ){
$ Con = MySQL (the best combination with PHP) _ pconnect ($ host, $ user, $ pass) or die (unable to connect to. $ host. Server );
MySQL (best combination with PHP) _ select_db ($ db, $ con) or die (unable to connect. $ db. database );
$ Rst = MySQL (the best combination with PHP) _ query ($ SQL, $ con) or die ($ SQL. Error );
If ($ cmd = query ){
$ Num_fields = MySQL (the best combination with PHP) _ num_fields ($ rst );
Echo Echo <table border = "1" cellpadding = "0" cellspacing = "0">;
Echo <caption align = "center">. $ SQL. </option>;
Echo <tr>;
For ($ I = 0; $ I <$ num_fields; $ I ++) echo <th> & nbsp ;. mySQL (best combination with PHP) _ field_name ($ rst, $ I ). </th>;
Echo </tr>;
While ($ row = MySQL (the best combination with PHP) _ fetch_row ($ rst )){
Echo <tr>;
For ($ I = 0; $ I <$ num_fields; $ I ++) echo <td> & nbsp;. $ row [$ I]. </td>;
Echo </tr>;
}
Echo </table>;
MySQL (the best combination with PHP) _ free_result ($ rst );
}
Else echo has. MySQL (the best combination with PHP) _ affected_rows ($ con). The row is affected;
}
?>
</Body>
</Html>