Sep 10 2012

old and new

i don’t really do programming, i don’t really know how to.

last time when i look for how to php+mysql select, i don’t see the suggested alternative. http://php.net/manual/en/function.mysql-select-db.php

a new stuff maybe. worth trying as I forgot the old way, and the new alternative is a new stuff to me. in short, currently I don’t know how to.

before this:

    $result2 = mysql_query(“SELECT * FROM score where name = $name “);
while($row = mysql_fetch_row($result2)) {
echo “$result2[0]”;
}

now:

    $stmt = $mysqli->prepare(“SELECT * FROM ahli WHERE id = ? LIMIT 1”);
$stmt->bind_param(‘s’, $uid);
$stmt->execute();
$stmt->store_result();

lebih kurang camtu la.

that’s what we called improvement.

but too bad for me. when it’s time for me to again use this stuff, i will re-look for them. haha..

perhaps another new stuff that time. haha

btw, it’s mysql vs mysqli. google search result is here: https://www.google.com.my/search?q=mysql+vs+mysqli