@Freeranger said:
I do just have to recreate the code, some parts dissappeared…
I have one more question too:
If I want to upload for example a minecraft mod, the file size is over 200mb, is there any way I can still make the downloadable?
Thanks
Yes, you can upload it to a specialized file hosting service where they allow larger files and share the link on your website. Sharing large files from a website hosting account is always a bad idea.
For some reason, this code gives me a HTTP 500 error. Do anyone know why?
<?php
require_once 'connect.php';
if(isset($_GET['keywords'])){
$keywords = $db->escape_string($_GET['keywords']);
$query = $db->query("
SELECT id, title, description
FROM search_product
WHERE id LIKE '%{$keywords}%'
OR title LIKE '%{$keywords}%'
OR decription LIKE '%{$keywords}%'
");
?>
<div class="result-count">
Found <?php $query->num_rows;?> results.
</div>
}
For some reason, this code gives me a HTTP 500 error. Do anyone know why?
<?php
require_once 'connect.php';
if(isset($_GET['keywords'])){
$keywords = $db->escape_string($_GET['keywords']);
$query = $db->query("
SELECT id, title, description
FROM search_product
WHERE id LIKE '%{$keywords}%'
OR title LIKE '%{$keywords}%'
OR decription LIKE '%{$keywords}%'
");
?>
<div class="result-count">
Found <?php $query->num_rows;?> results.
</div>
}
Thanks!
Did you check your error logs?
Regarding your code, I see two things:
A variable $db for which I can’t see what it is.
No error checking whatsoever. No exceptions are being caught and no connection errors are being checked.
Regardless of what $db is, a 500 error means your script crashes and your error logs should have more information. If they don’t, try to enable PHP display errors (can be found under Alter PHP Config in the control panel) to see if you can figure out the actual error.
Parse error: syntax error, unexpected end of file in /home/vol11_3/epizy.com/epiz_21490173/htdocs/search.php on line 19
Here’s the code:
<?php
require_once 'connect.php';
if(isset($_GET['keywords'])){
$keywords = $db->escape_string($_GET['keywords']);
$query = $db->query("
SELECT id, title, description
FROM search_product
WHERE id LIKE '%{$keywords}%'
OR title LIKE '%{$keywords}%'
OR decription LIKE '%{$keywords}%'
");
?>
<div class="result-count">
Found <?php $query->num_rows;?> results.
</div>
}
The last row is number 19. I can’t figure out what’s wrong!
Thanks! Think I’ve fixed that part, but now I get this error:
Warning: mysqli::__construct(): (HY000/1045): Access denied for user ‘epiz_21490173’@‘192.168.0.50’ (using password: YES) in /home/vol11_3/epizy.com/epiz_21490173/htdocs/connect.php on line 6
Warning: mysqli::escape_string(): Couldn’t fetch mysqli in /home/vol11_3/epizy.com/epiz_21490173/htdocs/search.php on line 6
Warning: mysqli::query(): Couldn’t fetch mysqli in /home/vol11_3/epizy.com/epiz_21490173/htdocs/search.php on line 12
Thanks, but I think the problem has with this to do:
Warning: mysqli::__construct(): (HY000/1045): Access denied for user ‘epiz_21490173’@‘192.168.0.50’ (using password: YES) in /home/vol11_3/epizy.com/epiz_21490173/htdocs/connect.php on line 6
Fixed that part, but now, I don’t get any number inside found results. Does this have with this code to do?
`<?php
require_once (‘connect.php’);
if(isset($_GET[‘keywords’])){
$keywords = $db->escape_string($_GET['keywords']);
$query = $db->query("
SELECT id, title, description
FROM search_product
WHERE id LIKE '%{$keywords}%'
OR title LIKE '%{$keywords}%'
OR decription LIKE '%{$keywords}%'
");
}
?>
<div class="result-count">
Found <?php $query->num_rows; ?> results.
</div>