in Education by
I have searched the net and so far what I have seen is that you can use mysql_ and mysqli_ together meaning: <?php $con=mysqli_connect("localhost", "root" ,"" ,"mysql"); if( mysqli_connect_errno( $con ) ) { echo "failed to connect"; }else{ echo "connected"; } mysql_close($con); echo "Done"; ?> or <?php $con=mysql_connect("localhost", "root" ,"" ,"mysql"); if( mysqli_connect_errno( $con ) ) { echo "failed to connect"; }else{ echo "connected"; } mysqli_close($con); echo "Done"; ?> Are valid but when I use this code what I get is: Connected Warning: mysql_close() expects parameter 1 to be resource, object given in D:\************.php on line 9 Done For the first and the same except with mysqli_close(). For the second one. What is the problem? Can't I use mysql_ and mysqli together? Or is it normal? Is the way I can check if the connections are valid at all? (the if(mysq...)) JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
No, you can't use mysql and mysqli together. They are separate APIs and the resources they create are incompatible with one another. There is a mysqli_close, though.

Related questions

0 votes
    Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 26, 2022 in Education by JackTerrance
0 votes
    I have a script which loops over tables and fields doing a find and replace. The script takes around ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
0 votes
    I need a way to modify a value in a table after a certain amount of time has passed. My current ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    May I know which Apache, PHP and MySql I am running if I decided to used other server solution/ ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to produce a page that would function a bit like a digital sticker album. My SQL ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    I'm trying to install Maatkit following the maatkit instructions. I can't get past having to install DBD: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 12, 2022 in Education by JackTerrance
0 votes
    Is there an easy way to run a MySQL query from the Linux command line and output the results in CSV format? Here's what I'm doing now: mysql -u uid -ppwd -D dbname...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I've a question about simplicity of a task. I'm fairly new to laravel and vue js, I'm used to ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    In two glasses A and B of mix juice, the ratio of pineapple and orange is 4: 3 and 6:1,respectively. If 14 ... the new glass of juice? Select the correct answer from above options...
asked Dec 27, 2021 in Education by JackTerrance
0 votes
    In two glasses A and B of mix juice, the ratio of pineapple and orange is 4: 3 and 6:1,respectively. If 14 ... the new glass of juice? Select the correct answer from above options...
asked Dec 26, 2021 in Education by JackTerrance
0 votes
    Recently, it has been made compulsory in India and some other countries to mix 10% ethanol with ... ,Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    Bring active dry yeast' from the market. Mix a spoonful of yeast, two spoonfuls sugar with a ... ,Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    This question's answers are a community effort. Edit existing answers to improve this post. It is not ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I try to print images with a for loop but the images dont load. The images are in the same ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
...