User Profile

Collapse

Profile Sidebar

Collapse
jthemans
jthemans
Last Activity: Dec 8 '12, 10:47 AM
Joined: Dec 8 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I need to get certain information out of a database

    Hello,

    I am working on something and it's a database with a list of book titles and years they have been published, I need to get the books that have been written for 1880 from the database only and with my code it shows all of the books with all the years, please help.

    My code:
    Code:
    		<?php
    					
    		$db = new PDO('mysql:host=localhost;dbname=boekenlijst','root','');
    		
    		$sql = "SELECT BoekNummer,
    ...
    See more | Go to post
    Last edited by jthemans; Dec 8 '12, 10:31 AM. Reason: Forgot something

  • Parse error: syntax error, unexpected '$sql' (T_VARIABLE), expecting catch (T_CATCH)

    Hi guys I need some help with this code, can't figure out why it isn't working.

    Code:
    			try {
    				$db = new                   
                            PDO('mysql:host=localhost;dbname=boekenlijst','root','');
    			}
    
    		
    			$sql = 'SELECT auteur FROM boekenlijst';
    and the error I am getting is:
    Parse error: syntax error, unexpected '$sql' (T_VARIABLE), expecting catch (T_CATCH)
    ...
    See more | Go to post
    Last edited by acoder; Dec 8 '12, 02:01 PM. Reason: Added [code] tags
No activity results to display
Show More
Working...