odbc mysql 4.0.20,Connect to old mysql server (4.0.20-standard) from php7

Solution:

Step 1: Install putty.exe + plink.exe in php7 machine. Step 2: I created this methods to do all the job for you/me. Example1:

$query = "SELECT * FROM user";

$rs = select($query);

if($rs)

for($index = 0; $index < count($rs);$index++){

//ALWAYS use this. Now u can use that array like a normal resultset $rs["lalala"]

$row1 = $rs[$index];

//use this like usual

echo $rs["username"];

}

Example2:

$query = "SELECT * FROM user";

$rs = select($query);

if($rs)

for($index = 0; $index < count($rs);$index++){

//ALWAYS use this. Now u can use that array like a normal resultset $rs["lalala"]

//$row1 = $rs[$index];

//now you didn't the line above...

echo $rs[$index]["username"];//you'll need something like $rs[0]["username"]

}

For update/delete/insert you can use something similar to the insert method. Example 3:

if(m_insert("insert into user (name,pwd,email) values ('kkk', 'hahaha', 'email@lala.com');")){

echo "true";

} else {

echo "false";

}

Remember1: You need to change the method variables (host, database, username, password, etc)...

Remember2: Change the mysql credentials at this line $commands[0] = 'mysql -u username -pPASSWORD...'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值