Help us understand the problem. What is going on with this article?

PHP7で、mysql_connect()が無いと怒られる件 (undefined function mysql_connect)

More than 3 years have passed since last update.

解決に時間がかかったので備忘として残す。
(主原因は思い込み)

新規案件で、PHPやることになったので
PHPの7入れてDB接続の確認しようとしたら

Fatal error: Call to undefined function mysql_connect()
と怒られ・・・
検索して、色々見た結果
※ver5.5以降ではmysql_系関数が使えないらしい。(既存は5系)
※まさか、Verアップで使えなくなる関数が有るとは思ってなかった

解決策は2つ
1、mysql_系関数を mysqli_系関数に書き換える。
 例:mysql_connect(。。。)
    ↓
   mysqli_connect(。。。)

2、古いモジュールを使用する(php-mysqlを入れる等)

既存システムをそのまま使いたいなら「2」だけど、
後ろ向き対応な気がするし、今回は新しい案件なので、
「1」で対応していきたい。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした