PHP If Else Issue

Discussion in 'PHP' started by sonu21, Jun 18, 2012.

  1. #1
    Hello Friends,I need your help.I need to insert details to Database if cookie is set.Below is the code:

    <?php if (@$cookie) { ?>
    Welcome User (I need to store the user to DB)
    <?php } else { ?>
    Welcome Guest
    <?php } ?>


    I need valid query to run this.I had try with common methods but it's not executing.Please help....

    Thanks in Advance!

     
    sonu21, Jun 18, 2012 IP
  2. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #2
    What clauseamsel was trying to say is... you obviously have no idea what you are doing so you should read a TUTORIAL on PHP and learn the language before diving in and attempting to make a script.

    If you were going on a 150 mile road trip would you first do your research and look at a map or would you just hop in your car and cross your fingers?

    Same with PHP... Before you head off to write a script...do your research so you know where you are going.

    And btw...noone can show you an SQL query because noone knows what you are doing or anything about this database that you probably don't have.
     
    NetStar, Jun 18, 2012 IP
  3. davidson_11

    davidson_11 Active Member

    Messages:
    33
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    80
    #3
    davidson_11, Jun 22, 2012 IP
  4. asadula

    asadula Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes davidason is right check that link out learn some more about php language then try to do something in php
     
    asadula, Jun 25, 2012 IP
  5. sonu21

    sonu21 Member

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    Thanks Guys,I got solution.

    Thanks for all your help!
     
    sonu21, Jul 11, 2012 IP
  6. meochain

    meochain Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Useful information.Thanks guys
     
    meochain, Jul 13, 2012 IP