473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

mysql_close and $DB->query problem

Hi
After i invoke mysql_close in a function, then i try to call " $DB-
>query("SELECT * FROM medewerker");" outside that function, it got
error. why?
thanks
from Peter (cm****@hotmail.com)
Jun 2 '08 #1
2 1189
On Tue, 13 May 2008 23:28:39 -0700 (PDT), peter <cm****@hotmail.com>
wrote:
>Hi
After i invoke mysql_close in a function, then i try to call " $DB-
>>query("SELECT * FROM medewerker");" outside that function, it got
error. why?
thanks
from Peter (cm****@hotmail.com)
Reconnect to the database if you closed the connection using
mysql_close.

Mitch
Jun 2 '08 #2
peter escribió:
After i invoke mysql_close in a function, then i try to call " $DB-
>query("SELECT * FROM medewerker");" outside that function, it got
error. why?
From PHP manual:

"mysql_query() sends an unique query (multiple queries are not
supported) to the currently active database on the server that's
associated with the specified link_identifier. [...] If the link
identifier is not specified, the last link opened by mysql_connect() is
assumed."

"mysql_close() closes the non-persistent connection to the MySQL server
that's associated with the specified link identifier. If link_identifier
isn't specified, the last opened link is used."

If you don't specify a link it's very likely that you only use one
connection in your whole script.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Jun 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: leegold2 | last post by:
Let's I do a mysql query and then I do a, for( $i = 1; $row = mysql_fetch_array($result); $i++ ) {...} and it gives me this: PageID Title URL Description 1 lee's ...
2
by: August | last post by:
In my continuing attempt to make a user module for my CMS work, I keep running into errors with the folowing query, which makes no sense to me at all: INSERT IGNORE INTO...
3
by: george.lengel | last post by:
Hello experts, I have been struggling for days to solve this problem and every suggestion I find via Google does not work for me. There is probably a solution out there that will do what I want,...
2
by: jim.clifford | last post by:
Hello. I have a slow response with a system that I am setting up. The OS is Win 2000 Server with SQL Server 2000. My first execution of the SQL procedure is slow (about 40 seconds), while the...
1
by: santaferubber | last post by:
The first query returns me the results from multiple databases, the second does the same thing except it puts the result into a #temp table? Could someone please show me an example of this using...
7
by: Lazoris | last post by:
Ok Mods got another test for ya.. Since I know you are good at this stuff maybe you can help me out again.. I started getting my pages the way I wanted them to look last weekend, and got pretty...
2
Colloid Snake
by: Colloid Snake | last post by:
Hello- I'm trying my hand at php, and seem to be stuck at a pretty basic point. I'm attempting to create a database driven menu list (such as if the Forums list on theScripts was to have a...
3
by: kato martin | last post by:
hi, i have designed an access database query with sums and expressions. however i have failed to retrieve any recordsets from this db query in vb6.... below i the code im currently using..but each...
4
bilibytes
by: bilibytes | last post by:
Hello i'm intrigued by what happens behind the scenes when I do a DB query to a database from php. I would like to know what is the exact life cycle of a mysql_query() I ask this question...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.