Job

Fix “undefined function mysql_connect” on an old PHP website

Replace removed mysql_* database calls in one old custom PHP site with mysqli or PDO, then test its data-entry and login flows on a copy.

What you get

  • Inventory of the removed database calls and their replacement
  • Changed code and before/after results for the five agreed flows
  • Switch-over and switch-back steps for the site holder
Price
From $515Final price agreed before we start
You pay
After the agreed checks pass and you sign off.
Term
One job
How soon
We set up the day after you ask and start work within three days.

No passwords, keys, card details or admin invites needed to start.

Price and terms in full

From $515 Final price agreed before we start

From $515 after a read-only count of mysql_* call sites and database layers. This floor covers up to 30 calls in one custom site. More call sites, other removed PHP 5 APIs or incompatible libraries need a new fixed scope or a stop.

You pay
After the agreed checks pass and you sign off. No advance payment.
Includes
One custom PHP site and up to 30 old database-call sites; Converted queries and five agreed read/write tests; Switch-back instructions
Term
One job
Technology
PHP, MySQL
Delivery
Start window and delivery date agreed in writing after eligibility and access checks.

Nothing is charged or booked when you send your details. The written quote confirms the total price and any tax before you accept.

What usually happened

You might be seeing

  • The website shows “Call to undefined function mysql_connect()”
  • Pages load but customer records are blank
  • The host says old mysql_* calls no longer work

Who it’s for: Owner of a custom PHP website that stopped showing data after a host changed PHP, with no developer to update the database code.

The result: The old site connects on the host’s supported PHP runtime and every agreed read and write flow works on a copy, with changed database code and rollback instructions handed over.

When it starts, and why it happens

Usually starts when: The host moves the site from PHP 5 to PHP 7 or 8 and pages show “Call to undefined function mysql_connect()”.

PHP removed the old mysql extension in PHP 7. A PHP 5 site whose database layer still calls mysql_connect, mysql_query or related functions cannot read or write its MySQL tables when the host switches versions. Unlike a routine PHP 7→8 compatibility change, every affected query and its error handling must be converted carefully.

What you get

Included

  • One custom PHP site on PHP 5 with up to 30 mysql_* call sites and one MySQL database
  • Convert database connections and queries to mysqli or PDO with prepared parameters for inputs
  • Test up to five data-reading and data-writing flows on a copy
Show 1 more
  • A handover with the changed files, test results and steps to switch the host’s PHP version

Not included

  • WordPress or a maintained CMS
  • A full PHP 8 compatibility upgrade across the entire application; other PHP 5 APIs may need their own scope
  • Database schema redesign or a move to another host
  • More than 30 call sites or a second database

How we know it’s done

Agreed with you before work starts. Each check produces evidence you keep.

Old PHP database connection: 4 checks and the evidence you keep4 checks, each with the evidence you keep: 1 No executable mysql_* calls in agreed code paths (evidence: Search results and changed-file list); 2 Read flow returns same data as PHP 5 (evidence: Before/after screenshots, database query checks); 3 SQL-metacharacter input does not change any unintended row (evidence: Saved values, row counts, reviewer check); 4 Error log shows no undefined mysql_* function error (evidence: Redacted log for the test window). When all pass: sign-off (Check before/after; sign off after live checks). When a check fails: Client does not pay and keeps our findings.What we checkEvidence you keep1 No executable mysql_* calls in agreed codepathsSearch results and changed-file list2 Read flow returns same data as PHP 5Before/after screenshots, database querychecks3 SQL-metacharacter input does not change anyunintended rowSaved values, row counts, reviewer check4 Error log shows no undefined mysql_* functionerrorRedacted log for the test windowAll pass: sign-offCheck before/after; sign off after live checksA check failsClient does not pay and keeps our findingsYou decide here Old PHP database connection: 4 checks and the evidence you keep4 checks, each with the evidence you keep: 1 No executable mysql_* calls in agreed code paths (evidence: Search results and changed-file list); 2 Read flow returns same data as PHP 5 (evidence: Before/after screenshots, database query checks); 3 SQL-metacharacter input does not change any unintended row (evidence: Saved values, row counts, reviewer check); 4 Error log shows no undefined mysql_* function error (evidence: Redacted log for the test window). When all pass: sign-off (Check before/after; sign off after live checks). When a check fails: Client does not pay and keeps our findings.1 No executable mysql_* calls inagreed code pathsEvidence: Search results and changed-file list2 Read flow returns same data as PHP5Evidence: Before/after screenshots, databasequery checks3 SQL-metacharacter input does notchange any unintended rowEvidence: Saved values, row counts, reviewercheck4 Error log shows no undefinedmysql_* function errorEvidence: Redacted log for the test windowAll pass: sign-offCheck before/after;sign off after livechecksA check failsClient does not payand keeps ourfindingsYou decide here
The checks we run, the evidence you keep for each, and what happens next. Drawn from the checks on this page.
The 4 checks in full, with the evidence you keep
  1. A scan of the patched source finds no executable mysql_* calls in the agreed code paths

    Evidence: Search results and changed-file list

  2. On the target PHP version, each agreed read flow returns the same test data as on the PHP 5 copy

    Evidence: Before/after screenshots and database query checks

  3. Each agreed write flow stores a legitimate apostrophe-containing test value literally once, and an SQL-metacharacter input does not change any unintended row or query structure

    Evidence: Saved test values and before/after row counts, plus the reviewer’s prepared-statement check

  4. The PHP error log shows no undefined mysql_* function error during the agreed flows

    Evidence: Redacted log for the test window

Sign-off. The client checks the agreed before/after results and signs off after the authorised live holder performs the named live checks.

If it fails. If the agreed checks do not pass, the client does not pay, and keeps our findings and rollback steps.

How we deliver

We arrange the work and independent review, then show you the result against the agreed checks. You keep authority over your systems.

Old PHP database connection: how it is delivered, step by stepSteps in order: 1 Restore the copy (on PHP 5 if possible; record each flow); 2 List every call (mysql_*, and the queries it runs); 3 Replace each call (mysqli or PDO, prepared statements for visitor input); 4 Run agreed flows (on target version, compare with PHP 5 copy); 5 Independent review (every converted query and its error handling); 6 Hand over (changed files, results, PHP switch and switch-back steps); 7 sign-off (Check before/after; sign off after live checks). You decide at the sign-off. We stop and tell you if any of the 5 conditions listed on this page applies.1 Restore the copyon PHP 5 if possible;record each flow2 List every callmysql_*, and thequeries it runs3 Replace each callmysqli or PDO, preparedstatements for visitorinput4 Run agreed flowson target version,compare with PHP 5copy5 Independentreviewevery converted queryand its error handling6 Hand overchanged files, results,PHP switch andswitch-back steps7 Sign-offCheck before/after; signoff after live checksWe stop and tell you ifany of the 5 conditions listed on this page appliesYou decide here Old PHP database connection: how it is delivered, step by stepSteps in order: 1 Restore the copy (on PHP 5 if possible; record each flow); 2 List every call (mysql_*, and the queries it runs); 3 Replace each call (mysqli or PDO, prepared statements for visitor input); 4 Run agreed flows (on target version, compare with PHP 5 copy); 5 Independent review (every converted query and its error handling); 6 Hand over (changed files, results, PHP switch and switch-back steps); 7 sign-off (Check before/after; sign off after live checks). You decide at the sign-off. We stop and tell you if any of the 5 conditions listed on this page applies.1 Restore the copyon PHP 5 if possible; record each flow2 List every callmysql_*, and the queries it runs3 Replace each callmysqli or PDO, prepared statements forvisitor input4 Run agreed flowson target version, compare with PHP 5 copy5 Independent reviewevery converted query and its error handling6 Hand overchanged files, results, PHP switch andswitch-back steps7 Sign-offCheck before/after; sign off after live checksWe stop and tell you ifany of the 5 conditions listed on this pageappliesYou decide here
How we deliver it, in order. A box with a coloured border is where you decide. Drawn from the delivery steps on this page.
The 6 delivery steps in full
  • Restore the copy on PHP 5 if possible and record each agreed read and write flow
  • List every mysql_* call and the queries it runs
  • Replace each call with mysqli or PDO, using prepared statements wherever a query takes visitor input
  • Run the agreed flows on the target PHP version and compare results with the PHP 5 copy
  • Independent review of every converted query and its error handling
  • Hand over the changed files, results and the PHP switch and switch-back steps

This is a one-off job, not emergency cover or a subscription. We confirm eligibility, the total price, a start window and a delivery date before you accept. Work starts only after agreed inputs, secure access, any licences and necessary permissions are in place. Hosting, platform and supplier charges are excluded unless the written quote includes them. No charge or booking is created by sending a message.

When it fits, and when we stop

It fits when

  • The host confirms the site ran on PHP 5 before the switch
  • The error or code contains mysql_* calls, not just mysqli_* calls
  • The source files and a safe database copy are available
Show 2 more
  • You can name the pages, login or forms that depend on the database
  • If the host has removed PHP 5, a separate restorable old environment or a tested supported-runtime rollback is available before the live change

We stop and tell you if

  • Source files are encoded or the database cannot be backed up
  • Card details are stored in the database or another regulated data problem requires a specialist
  • The code has more than 30 mysql_* call sites or multiple hidden database layers
Show 2 more
  • Fixing the mysql calls reveals unrelated PHP 5 APIs blocking the site on the new runtime
  • The host has removed the old PHP runtime and no safe alternative rollback environment can be prepared

Check whether this job fits

Four short questions. Your answers stay on this page unless you choose to email them.

Answer 4 questions to see if it fits
Does the error mention mysql_connect, mysql_query or another mysql_* function?
What PHP version did the site last work on?
Can the host provide both files and a database backup?
How much custom database code does the site have?

Answer the questions to see whether this job fits.

Nothing is sent anywhere until you choose to email us.

Ask about this job

Checks you can run yourself
  1. Read the error log

    Most control panels have an Errors or Logs page; your host can also send the PHP error log.

    Look for: “Call to undefined function mysql_connect()” or another name starting mysql_. Names starting mysqli_ point to a different fault.

  2. Count the old database calls

    Ask the site holder to search the source for mysql_* calls. A text search may include comments and vendor libraries, and multiple calls can appear on one line; it is only a clue, not the price-scope count.

    Look for: Ask the site holder for the number of executable old database calls in the site’s own code, not a count of matching lines. We check that number before quoting.

What could go wrong

3 risks, and how we handle each

Keep the old files and a database snapshot. If the host still offers PHP 5, your site holder may restore the old files and switch back after checking new writes. If PHP 5 is gone, rehearse an old-version container or alternate host under client control before cutover; without that rollback path, do not start the fixed job.

Scroll the table sideways to read it all.

RiskHow we handle it
A mechanical replacement changes query results or leaves SQL injection holesConvert calls with prepared parameters and compare actual read/write results, not just page status.
The new PHP version breaks unrelated PHP 5 codeTest named flows and stop for an agreed separate scope if another removed API blocks them.
A data copy contains customer informationUse sanitised fixtures where possible, isolated storage and deletion after sign-off.

A second reviewer checks each converted query for injection and changed results, and confirms nothing still calls a removed function on the agreed paths.

Need to keep it working?

A full-time AI agent can look after this kind of work, or tell us what you want looked after when you ask.

What ongoing work would cover, and what it does not

After database-call repair, discuss checking the named read/write flows whenever the runtime or dependencies change.

Ongoing work is separately scoped and quoted: no monitoring, response-time guarantee or automatic subscription is included in this job.

What you can check

Other ways to get this done
  • Ask the host whether it offers paid extended support for PHP 5 as a short-term bridge; PHP 5 is no longer security-supported and staying on it is not a fix.
  • If the site is small and rarely used, rebuilding the few pages and forms on a supported platform may be cheaper than maintaining all its old code.

Questions

Is this the same as a PHP 7 to PHP 8 upgrade?

No. PHP 7 removed mysql_* entirely. This job rewrites database calls from a PHP 5 site; the separate PHP 7→8 job fixes later compatibility changes.

Will this fix every problem on PHP 8?

Only the agreed database-dependent flows. We stop and tell you if other removed PHP 5 features need a separate upgrade.

Ask about this job

What to send us, what comes later, and who owns what

Send us

  • The exact error message or a screenshot with private data removed
  • The old and new PHP versions the host shows
  • The pages and forms that need database data
  • Whether the host can export the files and MySQL database

Later, once you agree

  • A controlled copy of source files and a sanitised database export
  • A test login if an agreed flow requires one
  • Your host’s staging PHP version and someone who can switch live PHP
  • A company-controlled secure handoff agreed before access: no live passwords, keys, private code or customer records by ordinary email.

The client owns the accounts, domain, live system and keys. An AI agent prepares the change using only an authorised test copy or read-only information; a separate reviewer checks the risks, and the client or their site holder approves any live change. Synthetic Industry is owned by a person and remains accountable for the agreed work. We never ask for passwords in your first message.

Add detail (optional)

A web address anyone can open, with no login in it. No code or logs.

We reply by email. Sending this emails your request to our team; nothing is kept in a website database. Please do not send passwords, keys or customer records. Privacy notice.

Email fallback: open your mail app

If website submission is unavailable, review and send the fallback email yourself. An email fallback is not a website receipt. Or write to hello@syntheticindustry.ai and say which job you mean.

Last revised 13 October 2026