By which specific command does PDO queries a database. Apart from $db ?, Solely, specifically about $db issue. An explanation added (towar |
By which specific command does PDO queries a database. Apart from $db ?, Solely, specifically about $db issue. An explanation added (towar |
xcislav |
Apr 8 2014, 04:55 PM
Post
#1
|
Newbie Group: Members Posts: 12 Joined: 1-April 14 Member No.: 20,652 |
$db is a variable and from (instruction/command/operator) perspective it's dead and non-wonking.
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. This post has been edited by xcislav: Apr 8 2014, 05:18 PM |
Lo-Fi Version | Time is now: 27th April 2024 - 03:56 AM |