Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAMP 500 Internal Server Error. MAC OSX php

Tags:

php

mamp

xcache

No results from my php code on the MAMP just got a 500 internal server error. Also I don't know if has something to do with XCache installed, no idea what's it but comes with MAMP. Here is my code. Trying to display an image binary stored on my mysql dB.

  <?php 
  mysql_connect("localhost", "root", "root") or die(mysql_error());
  mysql_select_db("catlogo") or die(mysql_error());
  $image = mysql_query("SELECT * FROM catlogo WHERE id=2");
  $image = mysql_fech_assoc($image);
  $image = $image['imagen'];

  header("Content-type:image/png");
  echo $image;

  ?>
like image 428
MethodistMX_Juan_Pluma Avatar asked Apr 17 '26 00:04

MethodistMX_Juan_Pluma


1 Answers

php Syntax Error

line 5:

$image = mysql_fech_assoc($image);

replace:

$image = mysql_fetch_assoc($image);
like image 132
54dev Avatar answered Apr 18 '26 13:04

54dev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!