Professional Web Applications Themes

problems - newbe - PHP Development

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 ...

  1. #1

    Default problems - newbe

    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

    in the place where the variable state

    mysql_free_result(): supplied argument is not a valid MySQL result resource
    in D:\Apache\Apache2\htdocs\index.php on line 279


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


    any one could me help ?!?





    Marceli Guest

  2. #2

    Default Re: problems - newbe

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


    Marceli Guest

  3. #3

    Default Re: problems - newbe

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


    Marceli Guest

  4. #4

    Default Re: problems - newbe

    Marceli Zaic wrote: 

    You're ing 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
    Veikko Guest

  5. #5

    Default Re: problems - newbe

    Marceli Zaic wrote: 

    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
    com


    Tony Guest

  6. #6

    Default Re: problems - newbe

    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


    Marceli Guest

  7. #7

    Default Re: problems - newbe

    "Marceli Zaic" <net.pl> kirjoitti
    viestissä:d8uctk$rts$news.tpi.pl... 

    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 ing about
    things.

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

    com


    Kimmo Guest

  8. #8

    Default Re: problems - newbe

    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


    Marceli Guest

  9. #9

    Default Re: problems - newbe

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

    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.
    therm off at your peril! Hey, I write poetry as well <ggg>.

    Adam.
    Adam Guest

  10. #10

    Default Re: problems - newbe

    Marceli Zaic wrote: 


    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
    Hilarion Guest

Similar Threads

  1. Newbe needs help
    By Sadman in forum PERL Beginners
    Replies: 6
    Last Post: August 17th, 07:27 PM
  2. newbe
    By Artemio in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 19
    Last Post: September 27th, 05:30 PM
  3. Newbe needs help.
    By bredal Jensen in forum ASP.NET Web Services
    Replies: 3
    Last Post: July 7th, 03:13 PM
  4. Newbe php help
    By eboogyman in forum PHP Development
    Replies: 4
    Last Post: October 1st, 03:29 PM
  5. newbe THANKS
    By Clif Gallagher in forum Linux Setup, Configuration & Administration
    Replies: 1
    Last Post: July 14th, 06:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139