我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

php表单从mysql变量中选择选项数组

Hopefully a simple one.

I am using a drop down on a form as follows:

// A sample product array
$products = array("Mobile", "Laptop", "Tablet", "Camera");

this works fine but rather than define the list I was hoping to populate the options using a variable populated from Mysql, Here is what I have

// A sample product array
$products = array<?php echo $customoption1data;>;

But I can't seem to get it to work.

The data in the table is formatted as "Mobile", "Laptop", "Tablet", "Camera"

Where am I going wrong?

近期文章

  • 在PHP中添加字符串不起作用
  • 从php特殊的char没有插入到mysql中
  • 重定向到PayPal Express Checkout时自动填写电子邮件帐户
  • 麻烦单引号和双引号
  • 使用Cron的Google API日历
  • 数据库表未从PHP网站代码正确更新
  • Marshmallow抛出FileNotFoundException,但旧版本没有
  • PHP中的TK102-2跟踪器
  • 如果我在控制器方法中创建方法而不是使用eloquent或查询构建器,Laravel5事务是否有效
  • 我想操纵源URL
  • Yii2 url重写后缀(php)问题
  • LDAP查找组PHP的成员
  • 未定义的偏移量:1- Laravel Error异常
  • 使用动态文本框进行批量插入
  • 无法获取正确的数据。 为foreach()警告提供的参数无效
  • PHP,MYSQL INSERT INTO umlauts,如ä,ü,ö
  • Wordpress - 如何链接到几个PHP脚本?
  • 同时运行两个不同的PHP程序
  • 为什么存储在会话变量中的数组计数加倍?
  • 基于关键php排列数组

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华