# Need some with PHP coding

**URL:** <https://www.phphelp.com/t/need-some-with-php-coding/34618>\
**Category:** General PHP Help\
**Created:** [March 25, 2022, 7:14pm UTC](https://www.phphelp.com/t/need-some-with-php-coding/34618 "2022-03-25T19:14:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeanantoine](https://www.phphelp.com/letter_avatar_proxy/v4/letter/j/f1d935/32.png) [@jeanantoine](https://www.phphelp.com/u/jeanantoine)\
**Post date:** [March 25, 2022, 7:14pm UTC](https://www.phphelp.com/t/need-some-with-php-coding/34618/1 "2022-03-25T19:14:34Z")

</div>

I got this PHP Warning: mysqli\_error() expects parameter 1 to be mysqli, null given in

I am lost

here is the code for the record.php:

```auto
$sql = "SELECT * FROM words where word_id='".$rows['word_id']."'";
 $result = $conn->query($sql) or die($conn->error);

if ($result->num_rows > 0){
while($row = $result->fetch_assoc() )
```

---

<div class="post-metadata">

**Author:** ![benanamen](https://www.phphelp.com/user_avatar/www.phphelp.com/benanamen/32/287_2.png) [@benanamen](https://www.phphelp.com/u/benanamen)\
**Post date:** [March 25, 2022, 7:39pm UTC](https://www.phphelp.com/t/need-some-with-php-coding/34618/2 "2022-03-25T19:39:14Z")

</div>

Where are you magically coming up with $rows[‘word\_id’] ?

Since you are just learning I would highly recommend you learn PDO.

> **[(The only proper) PDO tutorial](https://phpdelusions.net/pdo)**
>
> There are many tutorials on PDO already, but unfortunately, most of them fail to explain the real benefits of PDO, or even promote rather bad practices. The only two exceptions are \[phptherightway.com\](http://www.phptherightway.com/#pdo\_extension)...
