473,549 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql_close and $DB->query problem

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

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

"mysql_quer y() 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

"mysql_clos e() 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

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 gogle1.com This is lee's website. 1 lee's gogle2.com This is lee's website. 2 Jon's yaho1.com This is Jon's...
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 mos_comprofiler(id,user_id) SELECT id,id FROM mos_users"; where mos_comprofiler is a new parallel User DB and mos_users is the original database of users. This first...
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, but I probably have not properly implemented the solutions I find. I am trying to make a page to allow personnel the ability to search our...
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 second execution is faster (approx. 3 seconds and what I expect). Using query analyser I can leave the window up and come back ( after say 10 minutes...
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 the first query? The first query uses the @exec_context and I am having a challenge trying to figure out how to make the call from within a different...
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 far in what im trying to achieve basically, but I have a text issue now. The text that I am putting into the db and the echo'ed text are running off...
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 sub-list that was populated by a db query), and as such was using this page to guide me in trying to fetch the array of possible choices. This is my...
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 time i try, i get a message " data type mismatch in criteria expression" Dim Db As Database Dim RsM As Recordset Dim rsS As Recordset Dim dT As...
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 because i need to know what is the best solution to count the number of rows from a query. My query is performed to fetch records from a mysqlDb that...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.