# How do i put "?" there?

**URL:** <https://forum.infinityfree.com/t/how-do-i-put-there/18005>\
**Category:** Hosting Support\
**Created:** [July 9, 2019, 3:55pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005 "2019-07-09T15:55:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/6_449c533f586939b6e5f246632a46421f.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)\
**Post date:** [July 9, 2019, 3:55pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005/1 "2019-07-09T15:55:25Z")

</div>

hello! i recently was working on this code:

```auto
include "inc/config.php";
$slot = $_GET['slot'];
$id = $_GET['id'];
$stmt = $link->prepare("UPDATE crany_cranies SET crany_slot?='0' WHERE crany_id=?");
var_dump($stmt);
 $stmt->bind_param("ii", $slot, $id);

if ($stmt->execute() == TRUE) {
    echo "You dropped item from the pet successfully";
} else {
    echo "Error droping apparel: " . mysqli_error($link);
}

mysqli_close($link);

```

i wanted to drop an item from Requested slot. but i get this error:

```auto
Fatal error: Uncaught Error: Call to a member function bind_param() on bool in /home/vol6_8/epizy.com/epiz_23744660/htdocs/dropitem.php:8 Stack trace: #0 {main} thrown in /home/vol6_8/epizy.com/epiz_23744660/htdocs/dropitem.php on line 8

```

i know it’s belongs to this syntax:

```auto
crany_slot?='0'

```

i want the “?” becomes the requested slot. but that gave me the top error. i use this and works but it’s not safe at SQL injection.

```auto
crany_slot".$slot."

```

How should i put the “?” symbol near to the “crany\_slot”.

thank you for advise

---

<div class="post-metadata">

**Author:** ![anon57849175](https://forum.infinityfree.com/letter_avatar/anon57849175/32/6_449c533f586939b6e5f246632a46421f.png) [@anon57849175](https://forum.infinityfree.com/u/anon57849175)\
**Post date:** [July 9, 2019, 4:24pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005/2 "2019-07-09T16:24:26Z")

</div>

You may need to use the following code that uses PDO instead of MySQLi Procedural to do it (in this version of the code there aren’t English grammatical errors anymore):

```
<?php
require "inc/config.php";
$slot = $_GET["slot"];
$id = $_GET["id"];
$sql = "UPDATE crany_cranies SET crany_slot:slot = '0' WHERE crany_id = :id";
if ($stmt = $link->prepare($sql)) {
    $stmt->bindParam(":slot", $slot, PDO::PARAM_INT);
    $stmt->bindParam(":id", $id, PDO::PARAM_INT);
    if($stmt->execute()) {
           echo "You've dropped the item from the pet successfully.";
    } else {
           echo "Error dropping the item from the pet because of a database error.";
    }
}
?>

```

and modify the config.php to connect to the database using PDO.

---

<div class="post-metadata">

**Author:** ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/6_449c533f586939b6e5f246632a46421f.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)\
**Post date:** [July 9, 2019, 6:07pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005/3 "2019-07-09T18:07:46Z")

</div>

but i feel something not going true. i’ll true to fix it myself. it just gave me empty page without update

---

<div class="post-metadata">

**Author:** ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/6_449c533f586939b6e5f246632a46421f.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)\
**Post date:** [July 9, 2019, 6:36pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005/4 "2019-07-09T18:36:16Z")

</div>

i can’t post my new code. 403?

---

<div class="post-metadata">

**Author:** ![anon57849175](https://forum.infinityfree.com/letter_avatar/anon57849175/32/6_449c533f586939b6e5f246632a46421f.png) [@anon57849175](https://forum.infinityfree.com/u/anon57849175)\
**Post date:** [July 9, 2019, 6:39pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005/5 "2019-07-09T18:39:48Z")

</div>

You can post the code in a pastebin, so me and others can see it. Examples of pastebins are obviously [Pastebin.com](https://pastebin.com) and [0bin](https://0bin.net), but 0bin is more secure and encrypted. Then post a direct link for your code stored on a pastebin.

---

<div class="post-metadata">

**Author:** ![anon19508339](https://forum.infinityfree.com/letter_avatar/anon19508339/32/6_449c533f586939b6e5f246632a46421f.png) [@anon19508339](https://forum.infinityfree.com/u/anon19508339)\
**Post date:** [July 9, 2019, 6:40pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005/6 "2019-07-09T18:40:13Z")

</div>

try. thank you

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [September 7, 2019, 6:40pm UTC](https://forum.infinityfree.com/t/how-do-i-put-there/18005/7 "2019-09-07T18:40:18Z")

</div>

Closed on September 7, 2019, 6:40pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
