Reply to php sql "DROP TABLE" command

Your name:

Reply:


Posted by John S. on 11/13/07 07:19

I'm relatively new at this. I can use php to create a 'products'
table in the SQL 'ximport' database using similar code as shown below
but with the create rather than the drop command line. However, I
cannot use the drop command to delete the table 'products'. What is
wrong with the following code saved in a file called drop.php
downloaded to my host Globat and run from the Explorer 6 browser with
the url -- drop.php:

<html>
<head>
<title>Dropping a Database Table</title>
</head>
<body>
<br>***** BEGIN OF HTML PROGRAM *****<br>
<?php
$conn = mysql_connect('localhost','nameximport','pwsdximport');
echo $conn;
mysql_select_db('ximport',$conn);
$sql = "DROP TABLE IF EXISTS 'products'";
$result = mysql_query($sql,$conn);
echo $result;
?>
<br>***** END OF HTML PROGRAM *****<br>
</body>
</html>


Note the drop line ends with single quote, double qoute, semicolon.
There is always a secret. I can't seen to figure it out. Maybe
Globat has not implemented this feature?! Thanks for any help. It
would be much appreciated.

[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

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