PHP MySQL Integration (Step 2)

Dhananjaya Karandana
1 min readDec 18, 2018

--

Lets run MySQL Queries on PHP codes

  1. Making a Connection ( step 1 )
  2. This Article ( step 2 )

Prerequisites

Movies Table structure

PHP CODE to select all (*) from movies table

Use fetch_assoc() instead of fetch_object() to hold your SQL result in a associative Array, As shown below

http://php.net/manual/en/mysqli-result.fetch-assoc.php

References

http://php.net/manual/en/mysqli.query.php

http://php.net/manual/en/mysqli-result.fetch-object.php

http://php.net/manual/en/mysqli-result.free.php

--

--

Dhananjaya Karandana
Dhananjaya Karandana

Written by Dhananjaya Karandana

I’d ❤️ to break down complex topics into short & digestible tutorials

No responses yet