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

Home Posts Topics Members FAQ

mysql_close and $DB->query problem

Hi
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?
thanks
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>
wrote:
>Hi
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?
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("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
assumed."

"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

4
2265
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...
2
1523
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...
3
2252
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...
2
2614
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...
1
4142
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...
7
1879
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...
2
2867
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...
3
1846
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...
4
1853
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 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...
0
7743
Oralloy
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. ...
1
7504
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...
0
7832
tracyyun
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...
1
5391
isladogs
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...
0
5114
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...
0
3499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1965
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
1
1083
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
786
bsmnconsultancy
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.