我有一个PHP代码,它从mysql表中的字段生成一个列表.当我将信息提交到另一个数据库时,它不会在空格后显示任何内容 - 只是第一个单词(例如,如果我从下拉列表中选择'robe spot'而仅将sumbit'robe'插入到数据库中)
这是我的PHP代码:
<?
$dbHost = 'localhost'; // localhost will be used in most cases
// set these to your mysql database username and password.
$dbUser = 'user';
$dbPass = 'pass';
$dbDatabase = 'stock'; // the database you put the table into.
mysql_connect("localhost", "user", "pass") or die(mysql_error());
mysql_select_db("stock") or die(mysql_error());
$query="SELECT category FROM subcategory_table";
/* You can add order by clause to the sql statement if the names are to be displayed
in alphabetical order */
$result = …
Run Code Online (Sandbox Code Playgroud)