douqing0713 2014-05-18 18:19
浏览 56

PHP图像上传器无法连接到服务器/文件不存在

Hello I'm soon changing to mysqli but for now, what is the problem that the upload script won't allow me to upload pictures to my server. When I press the upload button it says that the file doesn't exist on mamp and on localhost it says that the index.php was not found. Can someone please help me with this problem.

<?php

ini_set('display_error', '1');

// connect to database

mysqli_connect('localhost','root','root') or die (mysqli_error());

mysqli_select_db("Uploader") or die(mysqli_error());

It gives this error (on my MAMP application):

Warning: mysqli_connect(): (HY000/2002): No such file or directory in - on line 18
Warning: mysqli_error() expects exactly 1 parameter, 0 given in - on line 18.

  • 写回答

1条回答 默认 最新

  • dter8514 2014-05-18 18:53
    关注

    mysqli_select_db

    This function should only be used to change the default database for the connection. You can select the default database with 4th parameter in mysqli_connect().

    Font: mysqli_select_db function

    You should change to:

    $link = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link));
    

    Font: mysqli_connect function

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题