I have been crucified by many people for still using the old 'method' mysql_query()
also I am in the process of launching my website which took me 4-months to complete and I would like to have maximum security for it.
So I thought now is probably the best time to get rid of the old habit and start using the new methods.
I have scanned over some tutorials but I have to admit it does seem rather (very) complicated compared to mysql_query()
The best way to learn is probably through example, so Im hoping someone would be kind enough to change the following example for me to a PDO and a MYSQLI statement so that I can see the difference between the two. If a brief explanation can be included it will be greatly appreciated...
Also what do you recommend is the easiest to learn? Mysqli or PDO
$sql="select * from Multiple_Picks where event_id = '$matchId' and
pick='$winner' and
abs(score-$winScore) = (select min(abs(score-$winScore)) from Multiple_Picks
where pick = '$winner' );";
$result = mysql_query($sql) or trigger_error(mysql_error()." in ".$sql);
while($row = mysql_fetch_array($result)){
//if(isset($row['member_nr'])){
$winingMember = $row['member_nr'];
$event = $row['event_id'];
$pick = $row['pick'];
$score = $row['score'];
$tournament=$row['tournament'];
$round=$row['round'];
}
Thanks for reading