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 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?