1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Upgrading database query code to MYSQLi or PDO

Discussion in 'MySQL' started by pmf123, Feb 29, 2016.

  1. #1
    Are there direct command replacements for the following, or is there more to it than that?

    $st1 = "SELECT * from `members` WHERE (memberid ='$usernum')";
    $r1 = mysql_query($st1, $sqlsession);

    if (mysql_num_rows($r1) )
    {
    while ($r2= mysql_fetch_array($r1)) {
    [whatever]
    }
    }

    I know the above well, but new to MYSQLi or PDO

    Thanks!
     
    pmf123, Feb 29, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    You're in the wrong forum - this has nothing to do with mysql, it does, however, have everything to do with PHP. I suggest you take your question there. I'm on my phone, elsewise I'd write a suggestion.
     
    PoPSiCLe, Feb 29, 2016 IP