Help - Search - Member List - Calendar
Full Version: problems - newbe
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
Marceli Zaic
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:ApacheApache2htdocsindex.php on line 178

in the place where the variable state

mysql_free_result(): supplied argument is not a valid MySQL result resource
in D:ApacheApache2htdocsindex.php on line 279


P.S.can i also cut the mysql warnings from my page


any one could me help ?!?

Marceli Zaic
ok i solve the second problem but the first problem is extant
could anyone tell me step by step how resolve it please

Marceli Zaic
wow everybody help me
wow it's wonderfull, so many people want help me
thank you GOD !!!

Veikko Mkinen
Marceli Zaic wrote:
QUOTE
wow everybody help me
wow it's wonderfull, so many people want help me
thank you GOD !!!

You're bitching about no-one answering within the 10 minutes you waited?
Get real! People are helping each other here _voluntarily_ and because
they want to. Soon as you start paying me 100 euro per hour, I'll stand
by here and answer only to your question.


-veikko

--
veikko
mail@ .com
makinen

Tony
Marceli Zaic wrote:
QUOTE
wow everybody help me
wow it's wonderfull, so many people want help me
thank you GOD !!!

A couple points:

First of all, it takes more than 10 minutes for your post to propogate to
every news server.

Second, those of us on this group are from all over the world. According to
the posting time, you posted your original message at 2:07am my time. I
just read it for the first time just now, at 10:45.

Third, if you want immediate help, try IRC.

Finally, if you want help, remember "you catch more flies with honey than
with vinegar"

--
Tony Garcia
Web Right! Development
[Email Removed]

Marceli Zaic
hi,
oki i'm sorry
i was desperate
but i wrote my first post at 13:36 PM then i were waiting .....
at 15:28 PM i wrote 3th post with render thanks to GOD
it wasn't 10 min. but 2 hours
so i'm sorry everybody
now when i apologize could somebody help me in my second problem
call to mind i'm newbe

thanks and sorry once again

Kimmo Laine
"Marceli Zaic" <[Email Removed]> kirjoitti
viestiss:d8uctk$rts$[Email Removed]...
QUOTE
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:ApacheApache2htdocsindex.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

[Email Removed]

Marceli Zaic
thx but how can i resolve the problem with online user i thought about
session but i don't how catch the moment when somebody cut connect with my
page f.e. user x is online user y just logged he see 2 user but when user x
logout and user z login he should see also number 2 - so how can i do it

sorry for my language i'm also newbe at it

Adam
On Sat, 18 Jun 2005 08:50:31 +0200, Marceli Zaic wrote:

QUOTE
hi,
oki i'm sorry
i was desperate
but i wrote my first post at 13:36 PM then i were waiting .....
at 15:28 PM i wrote 3th post with render thanks to GOD
it wasn't 10 min. but 2 hours
so i'm sorry everybody
now when i apologize could somebody help me in my second problem
call to mind i'm newbe

thanks and sorry once again

Good to hear - now go and say 200 Hail Mary's!! <hehe>.

I think the main thing you're likely to be short of (as a newbie) is
*patience*!

PHP is powerful but picky (as with any "language"). You need to go
slowly - and carefully.

I subscribe to many newsgroups, and the PHP ones are by far the better
ones very informative, and usually polite and good humoured. Piss
therm off at your peril! Hey, I write poetry as well <ggg>.

Adam.

Hilarion
Marceli Zaic wrote:
QUOTE
how can i resolve the problem with online user i thought about
session but i don't how catch the moment when somebody cut connect with my
page f.e. user x is online user y just logged he see  2 user but when user x
logout and user z login he should see also number 2 - so how can i do it


If user logs out (uses your "Log out" link) then destroy the session. Do it
also if user is inactive for some time, or mark the session as inactive and
do not count in such session, but remember to remove the mark when user goes
active again.

Hilarion


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.