Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
图像显示,php-mysql_Php_Mysql - Fatal编程技术网

图像显示,php-mysql

图像显示,php-mysql,php,mysql,Php,Mysql,我正在开发一个项目Personl,我遇到了一个问题 我的问题的细节 通过表单执行查询,该表单将我调到另一个页面,在该页面上显示查询,一切正常,它显示我需要的信息,但在查看用户图像时,通过请求调用我与该用户对应的ID,但下面不显示我的图像代码 以html格式显示图像的代码: <img src="../../registro/imagen.php?matricula=<?php echo $_POST['matricula']; ?>" width="

我正在开发一个项目
Personl
,我遇到了一个问题

我的问题的细节 通过表单执行查询,该表单将我调到另一个页面,在该页面上显示查询,一切正常,它显示我需要的信息,但在查看用户图像时,通过请求调用我与该用户对应的ID,但下面不显示我的图像代码

以html格式显示图像的代码:

<img src="../../registro/imagen.php?matricula=<?php echo $_POST['matricula']; ?>" width="150px" height="150px" />
 <?php
$numero=$_REQUEST['matricula'];
$tabla="alumno";
include("../../Connections/colegio.php");
$conexion=@mysqli_connect($hostname_colegio,$username_colegio,$password_colegio,$database_colegio);
    $sacar = "SELECT * FROM ".$tabla." WHERE (matricula=$numero)" ;
    $resultado = mysqli_query($conexion,$sacar);
while ($registro = mysqli_fetch_assoc($resultado))echo mysqli_error( $conexion );{
            $tipo_foto=$registro['matricula'];
             header("Content-type: image/jpg");
             echo $registro['matricula'];
}



mysqli_close($conexion);
?>
“width=“150px”height=“150px”/
代码按要显示的id搜索图像:

<img src="../../registro/imagen.php?matricula=<?php echo $_POST['matricula']; ?>" width="150px" height="150px" />
 <?php
$numero=$_REQUEST['matricula'];
$tabla="alumno";
include("../../Connections/colegio.php");
$conexion=@mysqli_connect($hostname_colegio,$username_colegio,$password_colegio,$database_colegio);
    $sacar = "SELECT * FROM ".$tabla." WHERE (matricula=$numero)" ;
    $resultado = mysqli_query($conexion,$sacar);
while ($registro = mysqli_fetch_assoc($resultado))echo mysqli_error( $conexion );{
            $tipo_foto=$registro['matricula'];
             header("Content-type: image/jpg");
             echo $registro['matricula'];
}



mysqli_close($conexion);
?>

可能会终止此问题,如果有帮助,我会留下正确的代码

    <?php  
$numero=$_REQUEST['matricula'];
  $consulta="select * from alumno WHERE (matricula = $numero)";
  $busca_fotos=mysql_query($consulta) or die("Error en: $busca_fotos:" .mysql_error()) ;
  while($ro=mysql_fetch_assoc($busca_fotos)){
   $url=$ro['matricula'];  

     echo  "
                <img src=\"../../registro/fotos/".$url.".jpg\" width=\"150\" height=\"150\" alt=\"\" />

            </a>
       ";
  }
?>


为什么要隐藏错误?请原谅,但不理解您的问题,您可以指导我删除连接字符串中的@符号谢谢Subin Thomas,我已删除@,但仍然没有显示图像阅读此@user2766089