All documentation which I googled is vague. It does not say explicitly:
Solely set $db makes an sql query.
For example I have one working code which greps a table from my DB:
CODE
<?php $db=new PDO('mysql:host=localhost;dbname=test;charset=utf8', 'root', 'hyuiuik'); foreach($db->query('SELECT * FROM TABBL') as $value) { echo $value['nn']; }
foreach seems to be this instruction.
I'm doing all this to build a voting system with like button (in js/php(pdo)/mysql(txt) - minimal implementation.
This plus one ("+1") "like button"-voting system which i want to have the maximum minimalist approach (no auth non-voting non-login). Just 1. Press - HTML/Javascript
<input type="button" id="like" onClick="like1()" value="+1">
<script>
function like1 {
like.value += 1
}
</script>
2. Send PHP (PDO!) 3. Receive Textfile (may be.. mysql) *it has to be as simple as it could be* 4. Show +1, which would be visible to other visitors (ajax/js - optional). That example to be working. I have mysql and apache and php PDO (php5.5.6)! (I've googled this http://lanother.tk/likebutton.html - complex)
And if I solve this PDO issue - it will be very important.