-5

I am using MariaDB10 PHP7 + WHMCS 7RC1 and IonCube7. When we open our test website we get the following error:

Fatal error: Cannot redeclare mysql_affected_rows() in [unknown] on line 0

Drew
  • 24,851
  • 10
  • 43
  • 78
pluton
  • 1
  • 1
  • 1
    And how on earth do you expect us to help without you posting the code? We are good, yes. But we are not _that_ good that we magically _guess_ your code lines. – arkascha Sep 25 '16 at 18:48
  • PHP7 and `mysql_affected_rows()`, like that'll work. – Funk Forty Niner Sep 25 '16 at 18:49
  • @arkascha ^ bit of a clue ;-) – Funk Forty Niner Sep 25 '16 at 18:50
  • @arkascha Maybe so, but then again... one never knows till my comment may happen to disappear ;-) – Funk Forty Niner Sep 25 '16 at 18:51
  • possible duplicate of [Why shouldn't I use mysql_* functions in PHP?](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php) – Funk Forty Niner Sep 25 '16 at 18:52
  • @arkascha I type faster than the system can catch up to me ;-) – Funk Forty Niner Sep 25 '16 at 18:53
  • Possible duplicate of [Why shouldn't I use mysql_* functions in PHP?](http://stackoverflow.com/questions/12859942) – Drew Sep 25 '16 at 18:54
  • [*Didn't I say that? lol...*](http://stackoverflow.com/questions/39690491/how-can-i-fix-this-error-i-am-using-mariadb10#comment66680357_39690491) @Drew – Funk Forty Niner Sep 25 '16 at 18:55
  • @Fred-ii- you missed the capital P. gotta work on that – Drew Sep 25 '16 at 18:55
  • that you were @arkascha You sure your grandpa wasn't part of the ["Magnificent Seven"](https://en.wikipedia.org/wiki/The_Magnificent_Seven)? – Funk Forty Niner Sep 25 '16 at 18:56
  • @Drew `P`otaytoe - `p`otahtoe. There, I got both :p :P lol – Funk Forty Niner Sep 25 '16 at 18:57
  • Hello guys. I am using WHMCS 7. Can you tell me which code do you need, so i can provide it here? – pluton Sep 25 '16 at 19:18
  • @pluton take a quick look at our [how to ask a good question](http://stackoverflow.com/help/how-to-ask) guide, that does help us help you. – dubes Sep 25 '16 at 21:08
  • @Fred-ii- Best comment in ages. As it's a redeclared error, the file is likely providing a back compatibility wrapper to fake the old mysql functions and delegate to mysqli or pdo, and the wrapper is carelessly included. Maybe the code has never been actually tested with 7. – Nick Sep 27 '16 at 17:03
  • @Nick Lordie; who knows. The OP posted this comment: *"Can you tell me which code do you need, so i can provide it here?"* and I had left the question before seeing it. That person should have posted full code from the "get go". There isn't anything I can do for him/her at this point. Up until we know which animal(s) we're dealing with here exactly, is anyone's guess really. – Funk Forty Niner Sep 27 '16 at 17:06
  • @Fred-ii- Exactly, and they're onto a losing wicket anyway as the code is protected, hence the line 0 and [unknown], so there's no source to show. They need to touch base with M @ WHMCS. – Nick Sep 27 '16 at 17:26

1 Answers1

0

PHP 7 removed support for the mysql_* functions. Do not use them.

Instead, convert all the calls to mysqli_* (and different calling sequence) or to the PDO API.

Rick James
  • 135,179
  • 13
  • 127
  • 222