Call to 'mysqli_connect()' Kills PHP Procedure
Posted by: Len_Jacobson@usa.net (---.hsd1.ca.comcast.net)
Date: October 17, 2019 07:59PM

I have the following code in a PHP procedure:
echo "<p>host_name:  $host_name</p>";
echo "<p>userid:  $userid</p>";
echo "<p>password:  $password</p>";
$connect = mysqli_connect("$host_name", "$userid", "$password"winking smiley;
echo "<p>connect_TEMP:  $connect</p>";

The first three 'echo' lines disp oklay as expected; the fourth 'echo' line does not display.

No error message is displayed from the call to 'mysqli_connect()'.

Why does the call to 'mysqli_connect() seemingly kill the PHP procedure?



Edited 2 time(s). Last edit at 10/17/2019 08:24PM by RiggsFolly.

Options: ReplyQuote
Re: Call to 'mysqli_connect()' Kills PHP Procedure
Posted by: RiggsFolly (Moderator)
Date: October 17, 2019 08:29PM

Hi
This is not a PHP teaching site I am afraid. We just try and support WAMPServer itself

However, the result of a mysqli_connect is not a scalar variable that you can simply echo.
Check the PHP manual for more details.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Call to 'mysqli_connect()' Kills PHP Procedure
Posted by: MilesWeb (46.101.44.---)
Date: October 18, 2019 10:33AM

Check if this help
[www.php.net]

MilesWeb.co.uk :: Web Hosting | cPanel | Windows Shared Server

Options: ReplyQuote
Re: Call to 'mysqli_connect()' Kills PHP Procedure
Posted by: RiggsFolly (Moderator)
Date: October 18, 2019 10:58AM

Welcome Miles,

You are more than welcome to help out on this site if you want, however please dont suggest PHP code to others that has been deprecated for many years and in this case was removed from the language as of PHP7.0 a version of PHP that itself is no longer supprted.

Also the code shown by the other person was obviously using the mysqli database extension anyway.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 2 time(s). Last edit at 10/18/2019 11:07AM by RiggsFolly.

Options: ReplyQuote


Sorry, only registered users may post in this forum.