Jump to content

el-Relente

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

el-Relente's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. Plural Sight offers some great introductory courses along with a 10-day free trial. After going through the basics of PHP you also get to then learn more about how PHP can interact with the world around it, such as server ini configuration, external APIs, 'web scraping' and more. It doesnt cover frameworks or how to utilise these.. These tutorials are good for someone looking to take a step towards learning it without "external dependancies" (Remember when there was a wave of developers that knew AngularJS / jQuery but didnt understand the basics of javascript? Yeah, you want to avoid becoming like that) The tutorials are more focused on 'vanilla php', and getting you to understand simple-to-advanced concepts such as built-in functions etc, and spitting out HTML etc. https://www.pluralsight.com/courses/php-get-started Disclaimer: I am not affiliated with them in any way. Edit: This is not specifically for PHP7 concepts, but PHP in general. I re-read this thread and realised the topic title. My apologies.
  2. Since no one has replied, i thought I'd just jump in and point you in a helpful direction Latest secure database class created by @judda (owner of TGL): https://github.com/awjudd/pdo-wrapper Read through the code in /src/. Your code would then end up something like: $config = Configuration::fromArray(["Hostname":"localhost","Database":"","Username":"","Password":""]); $this -> db = new Database($config); A basic query would look something like this (although you'd probably do some more validation to ensure you're passing an actual value into it): $user_id = $_SESSION['user_id']; $myResult = $this -> db -> query('SELECT username,email FROM users WHERE id={0:ud}', $user_id); if($myResult -> numberOfRows == 1){ print "Logged in as user " . $myResult -> getArray()['username']; } {0:ud} the zero means the first parameter after the query (in this case $user_id). 'ud' represents an unsigned decimal (ie, a non-negative number) If you were using a string you would us "s" instead of "ud". Read the file /src/Database/ValueType.php for more info on the different types. If the value handed in doesnt match the type expected in the query an error with be thrown. Lastly if you were doing a query that yields multiple results, you could iterate through it using something like: $myResult = $this -> db -> query('SELECT id,username FROM users ORDER BY id ASC"); foreach($myResult -> retrieveAllRows() as $key = >$value){ print "User ID #".$value['id'].' is username '.$value['username'].'<br />'; } Disclaimer: None of this code is tested, but theoretically should work.
  3. I'd like to see some pet games that reach outside of the traditional web browser. Let's see something that has related lore / canon in other media, such as books, video games, youtube animated series etc, with content directly linked into the petsite itself.
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Terms of Use, and Privacy Policy.