» »

MySQL napaka..

MySQL napaka..

lordgreg ::

Warning: 2 is not a valid MySQL-Link resource in /home/www/nettech.kelt.si/www/php/clanki/showclanek.php on line 53

tole mi napiše.. 53 vrstica je vrstica, ko zapiram povezavo z mysql bazo, torej mysql_close($new_connection).. napako mi javi samo pri treh od stotih fajlih.. pa vedno istih, torej je moja napaka?? samo kje???

OwcA ::

najverjetnejsa razlaga je, da ali ze prej nekje v skripti klices msql_close nad to povezavo, ali pa, da spremenljivko, ki predstavlja connection-handle nekje povozis ali unset-as

lordgreg ::

najverjetneje res.. bom videl.. upam, da imaš prav.. se mi pa zdi da ni niti eno niti drugo, saj sem že tole zadevo nekaj gledal, pa nisem nič našel.. šit

darh ::

sploh ne vem zakaj killaš connection ?

jest lepo skoz uporablam mysql_pconnect()... zlo uporabno, ker se ne connecta usakic k executas skripto...

vir: mysql help:

mysql_pconnect -- Open a persistent connection to a MySQL Server
Description

int mysql_pconnect ([string hostname [:port] [:/path/to/socket] [, string username [, string password]]])


Returns: A positive MySQL persistent link identifier on success, or false on error.

mysql_pconnect() establishes a connection to a MySQL server. The following defaults are assumed for missing optional parameters: host:port = 'localhost:3306', username = name of the user that owns the server process and password = empty password.

The hostname string can also include a port number. eg. "hostname:port" or a path to a socket eg. ":/path/to/socket" for the localhost.

Note: Support for ":port" wass added in 3.0B4.

Support for the ":/path/to/socket" was added in 3.0.10.


mysql_pconnect() acts very much like mysql_connect() with two major differences.

First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection.

Second, the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect()).

This type of links is therefore called 'persistent'.

Excuses are useless! Results are priceless!

lordgreg ::

to mi je tako jasno ja.. saj to bom tudi naredil. me pa zanima, v čem je finta, če je pconnect bolj uporaben.. ali sploh kdo potrebuje connect funkcijo?

darh ::

ehm... bodo to ze glavice pr PHP developmentu vedle bol... tud postGreSQL pa mSQL mata to fukncijo....

ne vem no... teoreticno in prakticno zadeva deluje in to hitrejs kot navaden connect... itak... nekak se ti ni treba skoz connectat....

kt da bi usakic kbi prsu u bajto mogu potrkat, tko gres pa skoz odprta vrata usakic... :PP
Excuses are useless! Results are priceless!

lordgreg ::

erm... 8-O, okej ...


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

PHP povezava z Mysql

Oddelek: Izdelava spletišč
16914 (759) snooze77
»

[php] Knjiga gostov

Oddelek: Izdelava spletišč
293147 (2350) darix
»

Spletna aplikacija - lasten SMTP strežnik

Oddelek: Omrežja in internet
333233 (2683) Klenobo
»

[c++] osnovna težava z mysql api

Oddelek: Programiranje
222048 (1687) SasoS
»

login v phpju?

Oddelek: Programiranje
471611 (1271) rc-car

Več podobnih tem