本文介绍了在mysql_fetch_array.mysql_fetch_array()中获取错误需要参数1为资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的代码。我收到以下错误



警告:mysql_fetch_array()要求参数1为资源,布尔值在C:\Program Files(x86)\ Ampmpth中给出第174行\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ($ getselect))



我的尝试:



< ;?php

if(isset($ _ GET ['ID']))

{

$ ID = $ _ GET ['ID' ];

$ getselect = mysql_query(SELECT * FROM booking_p WHERE ID ='$ ID');

while($ profile = mysql_fetch_array($ getselect))

{

$ firstname = $ profile ['firstname'];

$ email = $ profile ['email'];

$ phone = $ profile ['phone'];

$ city = $ profile ['address1'];

$ date = $ profile ['date '];

$ time = $ profile ['time'];

$ amount = $ profile ['amount'];

$ productinfo = $ profile ['productinfo'];

}}?>

解决方案




The following is my code. i'm getting following error

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\Ampps\www\pandit\test_editform.php on line 174

the problem is exactly n this line
while($profile=mysql_fetch_array($getselect))

What I have tried:

<?php
if(isset($_GET['ID']))
{
$ID=$_GET['ID'];
$getselect=mysql_query("SELECT * FROM booking_p WHERE ID='$ID'");
while($profile=mysql_fetch_array($getselect))
{
$firstname=$profile['firstname'];
$email=$profile['email'];
$phone=$profile['phone'];
$city=$profile['address1'];
$date=$profile['date'];
$time=$profile['time'];
$amount=$profile['amount'];
$productinfo=$profile['productinfo'];
} } ?>

解决方案




这篇关于在mysql_fetch_array.mysql_fetch_array()中获取错误需要参数1为资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 18:10