A
A
Albert Zurabyan2016-06-24 14:55:21
PHP
Albert Zurabyan, 2016-06-24 14:55:21

How to hide some object ids from a site from a SQL query?

How can I make this entry not show up?0957907fefc14459ad1984e340839e76.PNG

<?php

$sql = "SELECT * FROM kino WHERE janr='$janr_search' ORDER BY RAND() LIMIT 4";
$result = $db->query($sql); 

while($row = $result->fetch(PDO::FETCH_ASSOC)) {
echo "        
       
<div class='kinko1a'>
<a class='link11' href='index_films.php?id={$row['id']}'>
<div class='link111'>
{$row['images']}
{$row['title']}
</div>
</a>
</div>

      

";
}
?>

here is the code

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2015-11-25
@woonem

Change the first character in a file without loading the entire file into memory.

read about fopen, fwrite
open the file (stream), use fseek, send the stream for reading and writing. That is, we still have to overwrite the entire file, but we can do this through streams and then we don’t need to download the entire file.
Same as in the previous paragraph. Only here, instead of fseek, we first add one character to the new stream and then add everything from another stream.
In short, read what about streams in php.

L
landergate, 2016-06-24
@albertzurabyan9

Update this part of the query:
Add instead of 1, 2, 3, 4 - the id of the movies you don't want to show.

D
dev400, 2016-06-24
@dev400

You can add a sidebar_show column and write boolean to it.
$sql = "SELECT * FROM kino WHERE janr='$janr_search' AND show='true' ORDER BY RAND() LIMIT 4";
Manage checkbox from admin panel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question