You are here: Re: problems - newbe « PHP Language « IT news, forums, messages
Re: problems - newbe

Posted by Kimmo Laine on 06/18/05 10:19

"Marceli Zaic" <marcus@sci.net.pl> kirjoitti
viestissδ:d8uctk$rts$1@nemesis.news.tpi.pl...
> hi,
> i'm newbe in this and i've problems
> i create page and connect to mysql server (also own build)
> i've problem with:
> 1. online user ,
> 2. counter
>
>
> kod:
> ....
> <?php
> $linkowanie = @mysql_connect("localhost","jurek","ogorek");
> if (!empty($linkowanie))
> {
> if(mysql_select_db("myslaw" , $linkowanie)==true)
> {
> $asql = "select * from opona";
> $aresult= mysql_query($asql,$linkowanie);
> if ($aresult==true)
> {
> while($arow=mysql_fetch_array($aresult))
> {
> $aNumer = $arow["suma"];
> }
> mysql_free_result($aresult);
> }
> $assql = "UPDATE opona SET suma=$aNumer+1";
> $asresult= mysql_query($assql,$linkowanie);
> if ($asresult==true)
> {
> $aqresult=mysql_insert_id($linkowanie);
> }
> }
>
> }
> mysql_close($linkowanie);
> ?>....
> .....
> <?php
> print("$aNumer");
> mysql_free_result($aqresult);
> ?>
> unfortunatelly the first problem is to heavy for me i don't know how begin
> it
> the second problem - when i implement the code (over) i became this
> message
>
> on top page
> Warning: mysql_close(): supplied argument is not a valid MySQL-Link
> resource
> in D:\Apache\Apache2\htdocs\index.php on line 178

If you place "mysql_close($linkowanie);" inside the if block which you used
to test if the link is valid, you shouldn't get warnings about it not being
valid. And you can always silence warnings:
@mysql_close($linkowanie); // the at-sign tells php to quit bitching about
things.

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

eternal.erectionN0@5P4Mgmail.com

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация