- This topic is empty.
-
AuthorPosts
-
January 23, 2015 at 12:07 am #194050
Davies
ParticipantHi devs im actually having
problem on how to make the chatv2 script work in wampserver/online sever please kindly explain the installation process.https://css-tricks.com/chat2/
https://css-tricks.com/examples/Chat2.zipJanuary 24, 2015 at 9:42 am #194145Davies
ParticipantThis Is The Details I Typed In Dbcon.php (N.B- I’ve Created The Database And The User Before Inputing The Details.)
<?php
//Connection Page
define(HOST, ‘localhost’);
define(USERNAME, ‘dafe’);
define(PASSWORD, ‘dafe26’);mysqli_connect( HOST, dafe, dafe26) or die(“Could not connect”);
mysql_select_db (“chat2_db”)or die(‘Cannot connect to the database because: ‘ . mysql_error());//functions
function checkVar($var)This Was The Result I Got From Wampserver
( ! ) Notice: Use of undefined constant HOST – assumed ‘HOST’ in C:\wamp\www\Chat2\dbcon.php on line 3
Call Stack
# Time Memory Function Location
1 0.0000 138952 {main}( ) ..\jumpin.php:0
2 0.0000 153968 require_once( ‘C:\wamp\www\Chat2\dbcon.php’ ) ..\jumpin.php:5( ! ) Notice: Use of undefined constant USERNAME – assumed ‘USERNAME’ in C:\wamp\www\Chat2\dbcon.php on line 4
Call Stack
# Time Memory Function Location
1 0.0000 138952 {main}( ) ..\jumpin.php:0
2 0.0000 153968 require_once( ‘C:\wamp\www\Chat2\dbcon.php’ ) ..\jumpin.php:5( ! ) Notice: Use of undefined constant PASSWORD – assumed ‘PASSWORD’ in C:\wamp\www\Chat2\dbcon.php on line 5
Call Stack
# Time Memory Function Location
1 0.0000 138952 {main}( ) ..\jumpin.php:0
2 0.0000 153968 require_once( ‘C:\wamp\www\Chat2\dbcon.php’ ) ..\jumpin.php:5( ! ) Notice: Use of undefined constant dafe – assumed ‘dafe’ in C:\wamp\www\Chat2\dbcon.php on line 7
Call Stack
# Time Memory Function Location
1 0.0000 138952 {main}( ) ..\jumpin.php:0
2 0.0000 153968 require_once( ‘C:\wamp\www\Chat2\dbcon.php’ ) ..\jumpin.php:5( ! ) Notice: Use of undefined constant dafe26 – assumed ‘dafe26’ in C:\wamp\www\Chat2\dbcon.php on line 7
Call Stack
# Time Memory Function Location
1 0.0000 138952 {main}( ) ..\jumpin.php:0
2 0.0000 153968 require_once( ‘C:\wamp\www\Chat2\dbcon.php’ ) ..\jumpin.php:5( ! ) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\Chat2\dbcon.php on line 7
Call Stack
# Time Memory Function Location
1 0.0000 138952 {main}( ) ..\jumpin.php:0
2 0.0000 153968 require_once( ‘C:\wamp\www\Chat2\dbcon.php’ ) ..\jumpin.php:5
3 0.0469 154608 mysql_connect ( ) ..\dbcon.php:7
Cannot connect to the database because: Base ‘chat2_db’ inconnueJanuary 25, 2015 at 3:48 am #194175Anonymous
InactiveWhile that’s true, and you really should correct it, I don’t think that’s why the code’s failing. You’re mixing mysqli and mysql functions. Don’t.
January 25, 2015 at 11:35 am #194196Senff
ParticipantI’d say the error messages speak for themselves. Go through them one by one and see what they say.
For example, on line 7 you have:
mysqli_connect( HOST, dafe, dafe26) or die(“Could not connect”);
One of the error messages is:
( ! ) Notice: Use of undefined constant dafe – assumed ‘dafe’ in C:wampwwwChat2dbcon.php on line 7
With that, you can deduct that that line 7 should probably be:
mysqli_connect( HOST, 'dafe', 'dafe26') or die(“Could not connect”);
Having said that, that’s not what the original code is in the example on this site, AND as @BenWalker said, don’t mix up using
mysql
andmysqli
, AND (not unimportant) the original code is already 5 years old. In some cases that can be an eternity. -
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.