doufunuo4787 2015-11-10 00:24
浏览 46

MariaDB和PHP - 查询不能正常工作

What I am Running (so no one asks the obvious)

Database:                MariaDB ver. 10.0.20
Database client-version: libmysql - 5.6.27
PHP-version:             5.6.4
MYSQL-Extension:         mysqli

So I made the decision to immigrate my database to MariaDB. I have never had a problem with PHP and Mysql, but now I am learning that values are being selected weird from the database.

When I make the following query:

SELECT `stock_ticker`, `stock_simpleName` FROM `stocks` WHERE `stock_ticker` LIKE '%mon%' OR `stock_simpleName` LIKE '%mon%'

I get two results that are correct (Monsanto and Mondelez). When I run the same query in PHP, I get whatever the hell PHP wants to give me.


I have dissected the PHP code for days, and I promise, the code is sound. It has worked perfectly with other PHP and Mysql projects. I have determined it is a crossover between PHP and MariaDB possibly using the mysqli extension. I have no clue what the problem is though. Does anyone else know what it could be? Please help! This has been aggravating me for days. It might be a simple Google search, but everything I have searched has turned up nada.

  • 写回答

1条回答 默认 最新

  • dongnianwo8289 2015-11-10 00:36
    关注

    Have you checked your connection? Can you edit your question with more information about the database name etc? Perhaps, you might be connecting to the wrong database on PHP!

    I had problems like this, but was my fault, I forgot to change the name on my PHP connections config..

    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题