PHP - Begginer
Hello,
I'm Danchi and I'm begginer in PHP coding.
Similar TutorialsHello,
$sql = "Select * from picture WHERE category = animatio' ORDER BY id DESC LIMIT $start, $max"; $for = $numRows = $conn->query("SELECT COUNT(*) FROM picture WHERE category = 'animation'")->fetchColumn(); if ($for > 0) { foreach($conn->query($sql) as $row) { print '<p>"'.$row['title'].'"</p><br><img src="'.$row['img'].'" width="651" height="215" id="img" /><br><h1><a href="'.$row['img'].'" download="'.$row['img'].'"/>Download Cover</a></h1> <hr>'; } $conn = null; when i'm deleted this: if ($for > 0) { foreach($conn->query($sql) as $row) { print '<p>"'.$row['title'].'"</p><br><img src="'.$row['img'].'" width="651" height="215" id="img" /><br><h1><a href="'.$row['img'].'" download="'.$row['img'].'"/>Download Cover</a></h1> <hr>'; } Error disappear, but code not work. And error is: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' ORDER BY id DESC LIMIT -5, 5' at line 1' in D:\xamp\htdocs\uzdarbis\test.php:34 Stack trace: #0 D:\xamp\htdocs\uzdarbis\test.php(34): PDO->query('Select * from p...') #1 D:\xamp\htdocs\uzdarbis\test.php(41): covers() #2 {main} thrown in D:\xamp\htdocs\uzdarbis\test.php on line 3 if think what problem is he $sql = "Select * from picture WHERE category = animatio' ORDER BY id DESC LIMIT $start, $max"; but i cant uderstand where.. :/ if i do this; $sql = $conn->prepare("Select * from picture WHERE category = animatio' ORDER BY id DESC LIMIT $start, $max"); error disapear, but code dosent work :/ Hello, I have checked out many of the scripts and tried implementing them to help me scrape 1 single image from a url. Example www.123.com/333.png Getting a script to scrape that image isnt the problem. Im not sure on how to implement the simple curl to save the image every 30mins and name it in successive order so it appears as , 1.jpg, 2.jpg, 3.jpg I am working with a debian 6 server and php would be the easiest way to do this that i can work with. I have searched the web endlessly and still cant produce such thing. Any help is appreciated. i have to add a ckeditor to my CMS backend to the description textarea but no idea where or how to start.. anybody knows a good tutorial online i could use?? |