PHP Warning: mysql_oci fetch array_array() expects parameter 1 to be resource这个问题在补充的代码中怎么修改

php - Warning: mysql_fetch_array() expects parameter 1 to be resource, null given. - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
Possible Duplicate:
I'm trying to learn how to use AJAX correctly with PHP and MySQL. I've seen other people's posts on this site regarding the same example I'm working with, but I haven't seen anything about the same issues I'm having.
The site holding the source code is .The site I have hosting my code is .
The first link has a working example and the second link shows you the error I'm trying to figure out.
I tried to use mysqli, but it said something about expecting two parameters, so I changed it back. If anyone has suggestions on how to get it to work, I'd greatly appreciate it.
Error: mysql_fetch_array() expects parameter 1 to be resource, null given in /data/multiserv/users/748953/projects/1801445/www/test/getuser.php on line 24
The html code:
&!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&
&meta http-equiv="content-type" content="text/ charset=utf-8"&
&title&Ajax-PHP/MySQL Cooperation Test&/title&
&script type="text/javascript"&
function showUser(str)
if (str=="")
document.getElementById("txtHint").innerHTML="";
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange=function()
if (xmlhttp.readyState==4 && xmlhttp.status==200)
document.getElementById("txtHint").innerHTML=xmlhttp.responseT
xmlhttp.open("GET","getuser.php?q="+str,true);
xmlhttp.send();
&select name="users" onchange="showUser(this.value)"&
&option value=""&Select a person:&/option&
&option value="1"&Peter Griffin&/option&
&option value="2"&Lois Griffin&/option&
&option value="3"&Glenn Quagmire&/option&
&option value="4"&Joseph Swanson&/option&
&div id="txtHint"&Person info will be listed here.&/div&
$q=$_GET["q"];
include("dbinfo.inc.php");
$con = mysql_connect(localhost, $username, $password);
if (!$con)
die('Could not connect: ' . mysql_error());
mysql_select_db($database, $con);
$resul1 = mysql_query('SELECT * FROM `ajax_demo` WHERE id = \'\".$q.\"\'') or die(mysql_error());
echo "&table border='1'&
&th&Firstname&/th&
&th&Lastname&/th&
&th&Age&/th&
&th&Hometown&/th&
&th&Job&/th&
while($row = mysql_fetch_array($result))
echo "&tr&";
echo "&td&" . $row['FirstName'] . "&/td&";
echo "&td&" . $row['LastName'] . "&/td&";
echo "&td&" . $row['Age'] . "&/td&";
echo "&td&" . $row['Hometown'] . "&/td&";
echo "&td&" . $row['Job'] . "&/td&";
echo "&/tr&";
echo "&/table&";
mysql_close($con);
marked as duplicate by ♦
This question has been asked before and already has an answer. If those answers do not fully address your question, please .
first try to check the data of $q
and after that try with this query:
mysql_query("SELECT * FROM `ajax_demo`
WHERE id = '" . mysql_real_escape_string($q) ."'");
7,08211835
You have a spelling mistake you are assigning value in $resul1 and using mysql_fetch_array($result) notice $result
You have a spelling mistake you are assigning value in $resul1 and using mysql_fetch_array($result) notice $result.
14.7k73359
change your while statement into this:
while($row = mysql_fetch_array($result1))
Make sure to always review your code and always use a consistent naming convention, the error indicated by the server is already enough to detect to which part of the program the issue is occuring (no need to run any other function if you want to have a complete debugging settings for you development server set it up on the configuration files instead of doing it on the application itself but turn it off for the live server for security purposes).
"Error: mysql_fetch_array() expects parameter 1 to be resource, null given in /data/multiserv/users/748953/projects/1801445/www/test/getuser.php on line 24"
which means that the error is happening on line 24 of the file "/data/multiserv/users/748953/projects/1801445/www/test/getuser.php" and that the variable on the first parameter you have used on the function "mysql_fetch_array" is the one causing the problem because of the statement "expects parameter 1 to be resource" so you should go directly to which part of the program this error is pointing which is helpful for any programmer. ;)
Change $resul1 to $result1, you did wrote wrong there.
5,07162238
Not the answer you're looking for?
Browse other questions tagged
The week's top questions and answers
Important community announcements
Questions that need answers
By subscribing, you agree to the
Stack Overflow works best with JavaScript enabledphp - Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
Possible Duplicate:
Please help,
I get following Error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in......
Here is my Query:
$query = "SELECT ListNumber FROM residential";
$result1 = mysql_query($query);
if (mysql_num_rows($result1) &10){
$difference = mysql_num_rows($result1) - 10;
$myQuery = "SELECT * FROM `residential` ORDER BY `id` LIMIT 10,". $
$result2 = mysql_query($myQuery);
echo $result2;
$replace =
str_replace(", "," | ", $result2);
while ($line = mysql_fetch_array($result2, MYSQL_BOTH))
marked as duplicate by
This question has been asked before and already has an answer. If those answers do not fully address your question, please .
Your query ($myQuery) is failing and therefore not producing a query resource, but instead producing FALSE.
To reveal what your dynamically generated query looks like and reveal the errors, try this:
$result2 = mysql_query($myQuery) or die($myQuery."&br/&&br/&".mysql_error());
The error message will guide you to the solution, which from your comment below is related to using ORDER BY on a field that doesn't exist in the table you're SELECTing from.
4,02811539
mysql_fetch_array() expects parameter 1 to be resource boolean given in php error on server if you get this error :
please select all privileges on your server. u will get the answer..
142k33187265
The code you have posted doesn't include a call to mysql_fetch_array(). However, what is most likely going wrong is that you are issuing a query that returns an error message, in which case the return value from the query function is false, and attempting to call mysql_fetch_array() on it doesn't work (because boolean false is not a mysql result object).
13.1k23558
$result2 is resource link not a string to echo it or to replace some of its parts with str_replace().
5,57153263
This error comes when there is error in your query syntax check field names table name, mean check your query syntax.
142k33187265
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabledWarning: Array_push() Expects Parameter 1 To Be Array, Boolean Given
Similar Tutorials
Warning: Array_push() Expects Parameter 1 To Be Array, Boolean Given
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given In (please Help Me With This Warning I Really Need This)
if(isset($_POST['submit'])){
$name = $_POST['name'];
&form method="POST" action="hist1.php"&
&input type="hidden" name="name" value="&?php echo $name ?&" /&
$q = mysql_query("SELECT * FROM histact1 ORDER BY RAND() LIMIT 1");
while ($r1 = mysql_fetch_array($q)){
$id = $r1[0];
$question1 = $r1[1];
$opt1 = $r1[3];
$opt2 = $r1[4];
$opt3 = $r1[5];
&div class="Qset" id="q1"&&br /&&br /&
&label class="items"&1st Question :&/label& &br /&
&textarea class="textareaQ" name="question1" readonly&&?php echo $question1; ?&&/textarea&
&br /&&br /&
&p class="marA"&
&input type="radio" name="rad1" value="&?php echo $opt1; ?&" /&
&label class="lbl"&&?php echo $opt1 ?&&/label&&br /&
&input type="radio" name="rad1" value="&?php echo $opt2; ?&" /&
&label class="lbl"&&?php echo $opt2 ?&&/label&&br /&
&input type="radio" name="rad1" value="&?php echo $opt3; ?&" /&
&label class="lbl"&&?php echo $opt3 ?&&/label&&br /&
&div class="lr"&
&br /&&br /&&br /&&br /&
&a class="nxt" &href="#q2"&&label title="Proceed to 2nd Question"&Next&/label&&/a&
&br /&&br /&&br /&
&center&&hr width="90%" /&&/center&&br /&
&?php } ?&
&br /&&br /&
$q = mysql_query("SELECT * FROM histact1 ORDER BY RAND() LIMIT 1");
while ($r1 = mysql_fetch_array($q)){
$id = $r1[0];
$question2 = $r1[1];
$opt1 = $r1[3];
$opt2 = $r1[4];
$opt3 = $r1[5];
&div class="Qset" id="q2"&&br /&&br /&
&label class="items"&2nd Question :&/label& &br /&
&textarea class="textareaQ" name="q2" readonly&&?php echo $question2; ?&&/textarea&
&br /&&br /&
&p class="marA"&
&input type="radio" name="rad2" value="&?php echo $opt1; ?&" /&
&label class="lbl"&&?php echo $opt1 ?&&/label&&br /&
&input type="radio" name="rad2" value="&?php echo $opt2; ?&" /&
&label class="lbl"&&?php echo $opt2 ?&&/label&&br /&
&input type="radio" name="rad2" value="&?php echo $opt3; ?&" /&
&label class="lbl"&&?php echo $opt3 ?&&/label&&br /&
&div class="lr"&
&br /&&br /&&br /&&br /&
&a class="nxt" &href="#q1"&&label title="Proceed to 1st Question"&Back&/label&&/a& &|&&
&a class="nxt" &href="#q3"&&label title="Proceed to 3rd Question"&Next&/label&&/a&
&br /&&br /&&br /&
&center&&hr width="90%" /&&/center&&br /&
&?php } ?&
&br /&&br /&
$q = mysql_query("SELECT * FROM histact1 ORDER BY RAND() LIMIT 1");
while ($r1 = mysql_fetch_array($q)){
$id = $r1[0];
$question3 = $r1[1];
$opt1 = $r1[3];
$opt2 = $r1[4];
$opt3 = $r1[5];
&div class="Qset" id="q3"&&br /&&br /&
&label class="items"&3rd Question :&/label& &br /&
&textarea class="textareaQ" name="q3" readonly&&?php echo $question3; ?&&/textarea&
&br /&&br /&
&p class="marA"&
&input type="radio" name="rad3" value="&?php echo $opt1; ?&" /&
&label class="lbl"&&?php echo $opt1 ?&&/label&&br /&
&input type="radio" name="rad3" value="&?php echo $opt2; ?&" /&
&label class="lbl"&&?php echo $opt2 ?&&/label&&br /&
&input type="radio" name="rad3" value="&?php echo $opt3; ?&" /&
&label class="lbl"&&?php echo $opt3 ?&&/label&&br /&
&div class="lr"&
&br /&&br /&&br /&&br /&
&a class="nxt" &href="#q2"&&label title="Proceed to 2nd Question"&Back&/label&&/a& &|&&
&a class="nxt" &href="#q4"&&label title="Proceed to 4th Question"&Next&/label&&/a&
&br /&&br /&&br /&
&center&&hr width="90%" /&&/center&&br /&
&?php } ?&
&br /&&br /&
$q = mysql_query("SELECT * FROM histact1 ORDER BY RAND() LIMIT 1");
while ($r1 = mysql_fetch_array($q)){
$id = $r1[0];
$question4 = $r1[1];
$opt1 = $r1[3];
$opt2 = $r1[4];
$opt3 = $r1[5];
&div class="Qset" id="q4"&&br /&&br /&
&label class="items"&4th Question :&/label& &br /&
&textarea class="textareaQ" name="q4" readonly&&?php echo $question4; ?&&/textarea&
&br /&&br /&
&p class="marA"&
&input type="radio" name="rad4" value="&?php echo $opt1; ?&" /&
&label class="lbl"&&?php echo $opt1 ?&&/label&&br /&
&input type="radio" name="rad4" value="&?php echo $opt2; ?&" /&
&label class="lbl"&&?php echo $opt2 ?&&/label&&br /&
&input type="radio" name="rad4" value="&?php echo $opt3; ?&" /&
&label class="lbl"&&?php echo $opt3 ?&&/label&&br /&
&div class="lr"&
&br /&&br /&&br /&&br /&
&a class="nxt" &href="#q3"&&label title="Proceed to 3rd Question"&Back&/label&&/a& &|&&
&a class="nxt" &href="#q5"&&label title="Proceed to 5th Question"&Next&/label&&/a&
&br /&&br /&&br /&
&center&&hr width="90%" /&&/center&&br /&
&?php } ?&
&br /&&br /&
$q = mysql_query("SELECT * FROM histact1 WHERE question != '$question1' AND question != '$question2' AND question != '$question3' AND question != '$question4' ORDER BY RAND() LIMIT 1");
while ($r1 = mysql_fetch_array($q)){
$id = $r1[0];
$question5 = $r1[1];
$opt1 = $r1[3];
$opt2 = $r1[4];
$opt3 = $r1[5];
&div class="Qset" id="q5"&&br /&&br /&
&label class="items"&5th Question :&/label& &br /&
&textarea class="textareaQ" name="q5" readonly&&?php echo $question5; ?&&/textarea&
&br /&&br /&
&p class="marA"&
&input type="radio" name="rad5" value="&?php echo $opt1; ?&" /&
&label class="lbl"&&?php echo $opt1 ?&&/label&&br /&
&input type="radio" name="rad5" value="&?php echo $opt2; ?&" /&
&label class="lbl"&&?php echo $opt2 ?&&/label&&br /&
&input type="radio" name="rad5" value="&?php echo $opt3; ?&" /&
&label class="lbl"&&?php echo $opt3 ?&&/label&&br /&
&div class="lr"&
&br /&&br /&&br /&&br /&
&a class="nxt" &href="#q4"&&label title="Proceed to 4th Question"&Back&/label&&/a& &|&&
&input type="submit" title="Submit Answers" name="submit" class="submit" value=" Submit " onclick="return confirm('Are you sure you want to submit your answers?\nYou can review your answer by click the Back link')" /&
&br /&&br /&&br /&
&center&&hr width="90%" /&&/center&&br /&
&?php } ?&
Edited by mac_gyver, 09 October 2014 - 10:51 AM.
code in code tags please
Warning: Mysql_num_rows() Expects Parameter 1 To Be Resource, Boolean Given In
i give it up after 4 h.please help me, what i do wrong
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given I
Full error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\MyWebsite\poll\functions.php on line 28Been working all day to set up& some stuff in my website. Now currently working on the poll. Been stuck on this error and I don't know what to do.That's the function that throws this:Any help would be appreciated. Code: [Select]function getPoll($pollID){& &$query& = &SELECT * FROM polls LEFT JOIN pollAnswers ON polls.pollID = pollAnswers.pollID WHERE polls.pollID = & . $pollID . & ORDER By pollAnswerListing ASC&;& &$result = mysql_query($query);& &//echo $jquery& && &$pollStartHtml = '';& &$pollAnswersHtml = '';& && && &while($row = mysql_fetch_array($result, MYSQL_ASSOC))& &{& & & $pollQuestion& & & &= $row['pollQuestion'];& && & & $pollAnswerID& & & &= $row['pollAnswerID'];& && & & $pollAnswerValue& &= $row['pollAnswerValue'];& & & & & & if ($pollStartHtml == '') {& & & & &$pollStartHtml& & = '&div id=&pollWrap&&&form name=&pollForm& method=&post& action=&poll/functions.php?action=vote&&&h3&' . $pollQuestion .'&/h3&&ul&';& & & & &$pollEndHtml& & = '&/ul&&input type=&submit& name=&pollSubmit& id=&pollSubmit& value=&Vote& /& &span id=&pollMessage&&&/span&&/form&&&';& && & & }& & & $pollAnswersHtml& &= $pollAnswersHtml . '&li&&input name=&pollAnswerID& id=&pollRadioButton' . $pollAnswerID . '& type=&radio& value=&' . $pollAnswerID . '& /& ' . $pollAnswerValue .'&span id=&pollAnswer' . $pollAnswerID . '&&&/span&&/li&';& & & $pollAnswersHtml& &= $pollAnswersHtml . '&li class=&pollChart pollChart' . $pollAnswerID . '&&&/li&';& &}& &echo $pollStartHtml . $pollAnswersHtml . $pollEndH}
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given I
hey. im new to php and i get this error and i dnt know how to make it r8.here is my codeand also i get undefined index for name/comment/submit but they all seems to work fine.please help&?php&&&&&&&&&&&&require('contact.php');&&&&&&&&&&&&$name=$_POST[&name&];&&&&&&&&&&&&$comment=$_POST[&comment&];&&&&&&&&&&&&$submit=$_POST[&submit&];&&&&&&&&&&&&if($submit){&&&&&&&&&&&&&&&if($name&&$comment){&&&&&&&&&&&&&&&&&&$insQry=mysql_query(&INSERT INTO `comment`.`comment` (`name`,`comment`) VALUES ('$name','$comment')&);&&&&&&&&&&&&&&&}else{&&&&&&&&&&&&&&&&&&echo &pleace Fill All the Fields&;&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&}&&&&&&&&&?&&&&&&&&&&&&&&&&&&&&?php &&&&&&&&&$getqry=mysql_query(&SELECT * FROM comment ORDER BY id DECS&);&&&&&&&&&while($grows=mysql_fetch_array($getqry)){&&&&&&&&&$id=$grows['id'];&&&&&&&&&$name=$grows['name'];&&&&&&&&&$comment=$grows['comment'];&&&&&&&&&&&&&&&&&&echo $name . &&br /&&.$comment.&&br /&&.&&hr /&&;&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&?&
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given In
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\websiteku\modul\laporan\laporan.php on line 48
$query2 = "SELECT count(*) as jum1 FROM transaksi WHERE nama_kategori = '$namaBidang' AND nama_bayar = Uang";
& $hasil2 = mysql_query($query2);
& $data3 = mysql_fetch_array($hasil2);
& $jumGol1 = $data3['jum1'];
help me guys, how i fix this problem ??
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\ajaxpages\attendance\student_attendance.php on line 7&?php&$i=1;?&&?php&error_reporting();include("../../connect.php");&session_start();$class_id&=&$_POST['class_id'];$query&=&&mysql_query("SELECT&*&FROM&attendance&WHERE&class='$class_id'&ORDER&BY&student&ASC&");while($row&=&mysql_fetch_array($query))&&&&&&&&&&&&&&&&####LINE&7&----------------------------------------{?&&li&&div&class="num"&&?php&print&$i++?&&/div&&?php&print&$row['student'];&?&&/li&&?php&}?&
Warning: Mysql_num_rows() Expects Parameter 1 To Be Resource, Boolean Given In
i am try to make a name, address search system into my website from my database. but i got this msg [Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampplite\htdocs\3\searchresult.php on line 54]my full php code i.e. searchresult.php is under......what i have mistake.....searchresult.php&!DOCTYPE&html&PUBLIC&"-//W3C//DTD&XHTML&1.0&Transitional//EN"&"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&&html&xmlns="http://www.w3.org/1999/xhtml"&&head&&meta&http-equiv="Content-Type"&content="text/&charset=iso-8859-1"&/&&title&Untitled&Document&/title&&/head&&body&&?php//&TAKE&THE&INFORMATION&FROM&FORM.$search&=&$_GET['search'];//&IF&THERE&IS&NOT&A&KEYWORD&GIVE&A&MISTAKE.if&(!$search)echo&"You&didn't&enter&a&keyword";else{echo&"&td&You&searched&for:&&strong&$search&&/strong&&/td&";mysql_connect('localhost','root','');mysql_select_db('search');$id=@$_GET['id'];//QUERY&IS&THE&CODE&WHICH&WILL&MAKE&THE&SEARCH&IN&YOUR&DATABASE.//I&WROTE&AN&EXPLANATION&ABOUT&IT&AFTER&THE&CODE.$sql&=&"CREATE&TABLE&searchform&\n"&&&&."(\n"&&&&."ID&int&NOT&NULL&AUTO_INCREMENT&,\n"&&&&."FirstName&varchar(&255&)&NOT&NULL&,\n"&&&&."LastName&varchar(&255&)&NOT&NULL&,\n"&&&&."Email&varchar(&255&)&NOT&NULL&,\n"&&&&."PhoneNumber&varchar(&255&)&NOT&NULL&,\n"&&&&."PRIMARY&KEY&(&ID&)&)";;$result1&=&MySQL_query($query);if(!$result1)&{echo&MySQL_error()."&br&$query&br&";}if(MySQL_num_rows($result1)&&&5)&{echo&"&table&width='750'&align='center'&border='0'&cellspacing='0'&cellpadding='0'&";while($result2&=&MySQL_fetch_array($result1))&{//A&short&description&from&category.$description&=&$result2['category'];$searchPosition&=&strpos($description,&$search);$shortDescription&=&substr($description,&$searchPosition,&150);//&I&added&a&link&to&results&which&will&send&the&user&to&your&display&page.echo&'&tr&&td&&p&&strong&&a&href="displayresults.php?id='.$result2['id'].'"&'.$result2['title'].'&/strong&&/p&&/td&&/tr&';echo&"&tr&&td&$shortDescription&...&/td&&/tr&";echo&"&td&{$result2['name']}&{$result2['surname']}&/td&&tr/&";}echo&"&/table&";}else&{echo&"No&Results&were&found&in&this&category.&br&";}echo&"&br&";}?&&/body&&/html&andsearchform.php&!DOCTYPE&html&PUBLIC&"-//W3C//DTD&XHTML&1.0&Transitional//EN"&"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&&html&xmlns="http://www.w3.org/1999/xhtml"&&head&&meta&http-equiv="Content-Type"&content="text/&charset=iso-8859-1"&/&&title&Untitled&Document&/title&&/head&&body&&form&action="searchresult.php"&method="get"&&div&align="center"&&p&&input&name="search"&type="text"&size="60"/&&input&name="submit"&type="submit"&value="Search"&/&&/p&&/div&&/form&&/body&&/html&
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given I
Code: [Select]&?php&&&&$limit=12;if(isset(&$_GET['page']))&&&&&&$page=$_GET['page'];&&&&&&if($page&=0)&$page&=&1;&&&&&&&&&&&&else&{$start=0;}&&&$sql=mysql_query('select&*&from&tbl_gallery&where&status=1&AND&category_name="0"');&&&$count=mysql_num_rows($sql);&&&$totalcount=ceil($count/$limit);&&&$start=($page-1)*$&&&$s=mysql_query('select&*&from&tbl_gallery&where&status=1&AND&category_name="0"&limit&$start,&$limit');&&&while($result=mysql_fetch_array($s)){&&&&&&$start++;&&&&&&&?&MOD EDIT: code tags added.
Warning: Mysql_result() Expects Parameter 1 To Be Resource, Boolean Given
I have this code Code: [Select]$id = $_GET['esitysid'];$esitysnimi = mysql_query(&SELECT * FROM varasto WHERE id = '&.$id.&&, $yhteys);print &esitysnimi $esitysnimi&;$esitysnim = mysql_result($esitysnimi, &0&, &nimi&);varasto: Code: [Select]nimi
hinta maara id lippujaEsitys Nimi 1 10 14
0 5Esitys Nimi 2 120 5
1 0Esitys Nimi 3 950 5
2 0and it says Code: [Select]Warning: mysql_result() expects parameter 1 to be resource, boolean givenHow can I fix it? Thank you for help
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given I
I am getting the below error message:Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\EasyPHP-5.3.9\www\a.php on line 78The two issues a 1. The red text I need to somehow use the DISTINCT function as it is duplicating a person for every skill they have.2. The blue text is causing the error above, if I remove the join it works but assigns every possible skill to the person (because skill table and resource table are not joined). I therefore need the join there but without the error.My code is below:&!DOCTYPE& HTML PUBLIC &-//W3C//DTD HTML 4.01 Transitional//EN&& &http://www.w3.org/TR/html4/loose.dtd&& &&&&html& &&&& &head& &&&& & &meta& http-equiv=&Content-Type& content=&text/& charset=iso-8859-1&& &&&& & &title&Search& Contacts&/title&&style& type=&text/css& media=&screen&& &&&ul& li{ &&&& list-style-type: &&&} &&&&/style&& &&&& &/head&&&&&& &p&&body& &&&& & &h3&Search& Contacts Details&/h3& &&&& & &p&You& may search either by first or last name&/p& &&&& & &form& method=&post& action=&a.php?go&& id=&searchform&& &&&& & & &input& type=&text& name=&name&& &&&& & & &input& type=&submit& name=&submit& value=&Search&& &&&& & &&&&/form& &?php &&&& if(isset($_POST['submit'])){ &&&& if(isset($_GET['go'])){ &&&& if(preg_match(&/^[& a-zA-Z]+/&, $_POST['name'])){ &&&& $name=$_POST['name']; &&&& //connect& to the database &&&& $db=mysql_connect& (&127.0.0.1&, &root&,& &&) or die ('I cannot connect to the database& because: ' . mysql_error()); &&&& //-select& the database to use &&&& $mydb=mysql_select_db(&resource matrix&);&&&& //-query& the database table &&&& $sql=&SELECT * FROM ((resource l inner join resource_skill ln on l.Resource_ID = ln.Resource_ID) inner join skill n on ln.Skill_ID = n.Skill_ID) WHERE First_Name LIKE '%& . $name .& &%' OR Last_Name LIKE '%& . $name .&%' OR Skill_Name LIKE '%& . $name .&%'&; &&&& //-run& the query against the mysql query function &&&& $result=mysql_query($sql); &&&& //-create& while loop and loop through result set &&&& while($row=mysql_fetch_array($result)){ &&&& & & & & $First_Name& =$row['First_Name']; &&&& & & & & $Last_Name=$row['Last_Name']; &&&& & & & & $Resource_ID=$row['Resource_ID']; &&&& //-display the result of the array &&&& echo &&ul&\n&; &&&& echo &&li&& . &&a& href=\&a.php?id=$Resource_ID\&&&& &.$First_Name . & & . $Last_Name .& &&/a&&/li&\n&; &&&& echo &&/ul&&; &&&& } &&&& } &&&& else{ &&&& echo& &&p&Please enter a search query&/p&&; &&&& } &&&& } &&&& }//end of our letter search scriptif(isset($_GET['id'])){$contactid=$_GET['id'];//connect& to the database$db=mysql_connect& (&127.0.0.1&, &root&,& &&) or die ('I cannot connect to the database& because: ' . mysql_error());//-select& the database to use$mydb=mysql_select_db(&resource matrix&);//-query& the database table$sql=&SELECT * FROM ((resource l inner join resource_skill ln on l.Resource_ID = ln.Resource_ID) inner join skill n on ln.Skill_ID = n.Skill_ID) WHERE Resource_ID=& . $//-run& the query against the mysql query function$result=mysql_query($sql);//-create& while loop and loop through result setwhile($row=mysql_fetch_array($result)){& &&&& & $First_Name =$row['First_Name'];& & & & & & $Last_Name=$row['Last_Name'];& & & & & & $Mobile_Number=$row['Mobile_Number'];& & & & & & $Email_Address=$row['Email_Address'];&&&& & $Level=$row['Level'];&&&& & $Security_Cleared=$row['Security_Cleared'];& & & & & & $Contract_Type=$row['Contract_Type'];& & & & & & $Contract_Expiry=$row['Contract_Expiry'];& & & & & & $Day_Rate=$row['Day_Rate'];& & & & & & $Post_Code=$row['Post_Code'];&&&& & $Skill_Name=$row['Skill_Name'];//-display& the result of the arrayecho& &&ul&\n&;echo& &&li&& . $First_Name . & & . $Last_Name .& &&/li&\n&;echo& &&li&& . $Mobile_Number . &&/li&\n&;echo& &&li&& . &&a href=mailto:& . $Email_Address .& &&& . $Email_Address . &&/a&&/li&\n&;echo& &&li&& . $Level . &&/li&\n&;echo& &&li&& . $Security_Cleared . &&/li&\n&;echo& &&li&& . $Contract_Type . &&/li&\n&;echo& &&li&& . $Contract_Expiry . &&/li&\n&;echo& &&li&& . $Day_Rate . &&/li&\n&;echo& &&li&& . $Post_Code . &&/li&\n&;echo& &&li&& . $Skill_Name . &&/li&\n&;echo& &&/ul&&;}} &&&?& &&&&/body& &&&&/html&& &&&&&&
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given I
I have that error repeated alot : here are the other errorsWarning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 14Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 15Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 14Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 15The first 20 lines look like this : Code: [Select]final class MySQL {& & const ASSOC = MYSQL_ASSOC;& & & & public static function Connect($func_host, $func_user, $func_pass) { return mysql_connect($func_host, $func_user, $func_pass); }& & public static function Select($func_database)& & & & & & & & & & & { return mysql_select_db($func_database);& & & & & & & & & &}& & public static function &Query($func_query)& & & & & & & & & & & & &{ return mysql_query($func_query);& & & & & & & & & & & & & }& & public static function FetchArray(&$func_res, $func_type)& & & & & { return mysql_fetch_array($func_res, $func_type);& & & & & }& & public static function FreeResult(&$func_res)& & & & & & & & & & & { return mysql_free_result($func_res);& & & & & & & & & & & }& & public static function Error()& & & & & & & & & & & & & & & & & & &{ return mysql_error();& & & & & & & & & & & & & & & & & & &}& & & & public static function GetData($func_statement) {& & & $func_retVal = array();& & & & & & $func_res = self::Query($func_statement);& & & while($func_line = self::FetchArray($func_res, MySQL::ASSOC)) $func_retVal[] = $func_& & & MySQL::FreeResult($func_res);& & & & & & return $func_retV& & }& & & & public static function Insert($func_table, $func_data) {Thanks for help and the mysql info is correct..
Warning: Mysql_result() Expects Parameter 1 To Be Resource, Boolean Given
Hi thereI am having a problem with this warning message being thrown&Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\css\rnfunctions.php on line 302&and again for line 303Here is the codefunction&receiveuserchange(){if&(isset($_POST['level'])){$query&=&"SELECT&*&FROM&users";$result=mysql_query($query)&or&die("Invalid&Query&:&".mysql_error());$num=mysql_numrows($result);$i=0;while&($i&&&$num)&{////////////////here&are&lines&302&and&303///////////////////////////////$user=mysql_result($result,$i,"user");$id=mysql_result($result,$i,"id");/////////////////////////////////////////////////////////////////////////////if&(isset($_POST["$user"])){$level&=&($_POST["$user"]);$query&=&"update&profiles&set&level='$level'&where&pid='$id'";$result=mysql_query($query)&or&die("Invalid&Query&:&".mysql_error());ViewUsers('viewusers.php');}else{echo&"$user&not&recieved";}$i++;}Can anyone see what the problem is?
Warning: Mysql_result() Expects Parameter 1 To Be Resource, Boolean Given In D:\
don't know what to do next with this error popping up,,,any help?&?php&&&&&&//set up the variables&&&&&&$loguser = $_POST['loguser'];&&&&&&$logpass = md5($_POST['logpass']);&&&&&&$login = $_get['login'];&&&&&&&&&&&&//connect with the server and the database&&&&&&mysql_connect(&localhost&,&root&,&&) or die(&Can't connect with the Server!&);&&&&&&mysql_select_db(&comp3project&) or die(&Can't connect with the database!&);&&&&&&&&&&&&if($login=&yes&)&&&&&&&&&{&&&&&&&&&$get = mysql_query(&SELECT count(cid) FROM customer_data WHERE username = '$loguser'&&&&&&&&&&&&and password = '$logpass'&);&&&&&&&&&$result = mysql_result($get,0);&&&&&&&&&&&&&&&&&&if($result!=1){print &Login Failed!&;}&&&&&&&&&else {print &Login Successful!&;}&&&&&&}&&&?&
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given..
Hey all,The mysql_query function is failing in the show function and I'm not sure why:
function&index($item){
db_connect();
$query&=&"SELECT&*&FROM&$item&ORDER&BY&$item.id&DESC";
$result&=&mysql_query($query);
$result&=&db_result_to_array($result);
function&show($item,&$id){
db_connect();
$query&=&sprintf("SELECT&*&FROM&$item&WHERE&$item.id&=&'%s",&
mysql_real_escape_string($id));
$result&=&mysql_query($query);
$row&=&mysql_fetch_array($result);
//Stuff&that&belongs&in&view
&$books&=&index('books');
foreach($books&as&$book){
echo&$book['title'].'&/&br&';
$book&=&show('books',&1);
echo&$book['title'].'&/&br&';Thanks for any response.
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given I
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\New\cartnisya.php on line 15Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\New\cartnisya.php on line 74CODE$db = mysql_connect(&localhost&, &root&,&&);mysql_select_db(&vinnex&,$db);mysql_query(&Delete From temptransaction&,$db);//mysql_query(&Delete From temporderdetails&,$db);$Username = $_POST['Username'];$Password = $_POST['Password'];$result = mysql_query(&Select TransNo From transaction&, $db);$myrow = mysql_fetch_array($result);if ($myrow==''){&&&$TransNo=';;&&&$q = mysql_query(&Select Username, Lastname, Firstname From customer where Username=$Username, Lastname=$Lastname, Firstname=$Firstname &);&&&$myrow1 = mysql_fetch_array($q);&&&$Username = $myrow1['Username'];&&&$Firstname = $myrow1['Firstname'];&&&$Lastname = $myrow1['Lastname'];&&&$name = $Firstname. & &.$L&&&$sql1 = & INSERT INTO temptransaction (TransNo, Username, Firstname, Date)&&&&&&&&&& VALUES ('$TransNo', '$Username', '$Firstname', '$Date')&;&&&$result = mysql_query($sql1) or die(mysql_error());}else{&&&$sql = mysql_query(&Select max(TransNo) maxTransNo From transaction&, $db);&&&$myrow1 = mysql_fetch_array($sql);&&&$orderno = $myrow1['maxTransNo']+1;&&&$sql = mysql_query(&Select Username, Lastname, Firstname From customer where Username=$Username, Lastname=$Lastname, Firstname=$Firstname&);&&&$myrow1 = mysql_fetch_array($sql);&&&$Username = $myrow1['Username'];&&&$Firstname = $myrow1['Firstname'];&&&$Lastname = $myrow1['Lastname'];&&&$Date = date('m/d/y');&&&$sql1 = & INSERT INTO temptransaction (TransNo, Username, Firstname, Date)&&&&&&&&&& VALUES ('$TransNo', '$Username', '$Firstname', '$Date')&;&&&$result = mysql_query($sql1) or die(mysql_error());}please help masters im just newbie in php.
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given I
I can't find what's wrong with the code...&?php$Sql = &select team1, team2, t1outcome, t2outcome, winner from coupons where user='$User'&;$Result = mysql_query($Sql, $Link);print &&table cellpadding=0 cellspacing=0 border=0&&;print &&tr&&;print &&td align=left valign=top&&&&&&&/td&&;print &&td align=left valign=top&&&/td&&;print &&/tr&&;while($Row = mysql_fetch_array($Result)){if($Row[team1] == $Row[winner]){print &&tr&&;print &&td align=left valign=top&&&&&&&/td&&;print &&td align=left valign=top&&bold&$Row[team1]&/bold& - $Row[team2] $Row[t1outcome]-$Row[t2outcome]&/td&&;print &&/tr&&;} else {print &&tr&&;print &&td align=left valign=top&&&&&&&/td&&;print &&td align=left valign=top&$Row[team1] - $Row[team2] $Row[t1outcome]-$Row[t2outcome]&/td&&;print &&/tr&&;}}print &&/table&&;mysql_close($Link);?&
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource Boolean Given In
HELP ME TO CHANGE THE ERROR&?PHP //Include connection to databaseinclude('connect.php');//Get posted values from form$status=$_POST['status'];$date=$_POST['date'];//Strip slashes$status = stripslashes($status);$date = stripslashes($date);&//Strip tags $status = strip_tags($status);$date = strip_tags($date);//Inset into database$insert_status = mysql_query(& insert into status (status) value ('$status')&) or die (mysql_error());$insert_status = mysql_query(&insert into status (date) value ('$date')&) or die (mysql_error());while($row = mysql_fetch_array($insert_status)) {& (ERROR IS IN THIS LINE)$status=$row['status'];$date=$row['date'];}//Line break after every 80$status = wordwrap($status, 80, &\n&, true);//Line breaks$status=nl2br($status);//Display status from data baseecho '&div class=&load_status&&&div class=&status_img&&&img src=&blankSilhouette.png& /&&/div&&div class=&status_text&&&a href=&#& class=&blue&&Anonimo&/a&&p class=&text&&'.$status.'&/p&&div class=&date&&'.$date.' & &a href=&#& class=&light_blue&&Like&/a& & &a href=&#& class=&light_blue&&Comment&/a&&/div&&/div&&div class=&clear&&&/div&&/div&';?&
Warning: Mysql_fetch_assoc() Expects Parameter 1 To Be Resource, Boolean Given I
Hi, I'm fairly new to PHP and have run into this problem, I have tried looking through some other peoples solutions to this but don't quite understand them!I have set up a simple news post on a website which works fine, however when I go to edit a post and try to submit it again it comes up with this error:Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Users/mdfcows/Sites/atelier/editnews.php on line 61It still works, i.e. posts it, however I don't quite know what this means, and now I am trying to set it up so that another page can be edited and all I am getting is the same error on the page without any of the other info or PHP coming up!this is the PHP I am using, with the line &while ($row = mysql_fetch_assoc ($result)) {& being line number 61 Code: [Select]&?php
require_once('config.php');
$con&=&mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if&(!$con){
die('Failed&to&connect&to&server'&.&mysql_error());
mysql_select_db(DB_DATABASE);
$ide&=&$_POST[idf];
$query&=&"SELECT&image,id,title,text&FROM&news&WHERE&id&=&$ide";
$result&=&mysql_query($query);&
while&($row&=&mysql_fetch_assoc&($result))&{
$title&=&htmlentities&($row['title']);
$news&=&nl2br&(strip_tags&($row&['text'],&'&a&&b&&i&&u&'));
$image&=&$row['image'];
echo&"&form&class&='addform'&action='editnews.php'&enctype='multipart/form-data'&method='post'&";
echo&"&input&type='hidden'&name='ida'&value='$ide'&/&";
echo&"&p&Title:&br&/&&input&class='titlefield'&type='text'&name='title'&value='$title'&/&&/p&&br&/&";
echo&"&p&News&Post:&br&/&&&textarea&name='news'&rows='12'&cols='50'&$news&/textarea&&/p&&br&/&";
echo&"&p&If&you&uploaded&an&image&with&your&post&you&will&need&to&upload&it&again&br&/&&input&type='hidden'&name='MAX_FILE_SIZE'&value='9;&/&&&input&name='userfile'&type='file'&value='$image'&id='userfile'&/&&/p&&br&/&";
echo&"&p&&input&name='submit'&type='submit'&value='Submit'&/&&/p&";
echo&"&/form&";
if&($_POST['submit'])
&&mysql_select_db(DB_DATABASE);
&&$upid&=&$_POST[ida];
&&$uptitle&=&$_POST[title];
&&$upnews&=&$_POST[news];
&&$upimage&=&$_FILES['userfile']['name'];
&&$sql&=&"UPDATE&news&SET&title&=&'$uptitle',&text&=&'$upnews',&image&=&'$upimage'&WHERE&id&=&'$upid'";
&&mysql_query($sql);
&&if&($_POST['submit'])
&&echo&"&p&class='admintext'&Your&post&has&been&Edited&-&&a&href='index.php'&View&Latest&News&Page&/a&&/p&&br&/&";
&&$name&=&$_FILES['userfile']['name'];
&&$type&=&$_FILES['userfile']['type'];
&&$size&=&$_FILES['userfile']['size'];
&&$tmpname&=&$_FILES['userfile']['tmp_name'];
&&$ext&=&substr($name,&strrpos($name,&'.'));
&&if&(strstr($type,&"image"))
&&move_uploaded_file($tmpname,&"images/".$name);
?&Any help would be much appreciated!Thank youMartin
Warning: Mysql_fetch_assoc() Expects Parameter 1 To Be Resource, Boolean Given
When i try and use this app on my website i get the error, Code: [Select]Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/unionc/public_html/auction/scripts/updateTables.php on line 15 Code: [Select]&?php&&&&$now&=&time();
add_column_if_not_exist("WA_SellPrice",&"seller",&"VARCHAR(&255&)&NULL"); add_column_if_not_exist("WA_SellPrice",&"buyer",&"VARCHAR(&255&)&NULL"); add_column_if_not_exist("WA_Players",&"canBuy",&"INT(11)&NOT&NULL&DEFAULT&&'0'"); add_column_if_not_exist("WA_Players",&"canSell",&"INT(11)&NOT&NULL&DEFAULT&&'0'"); add_column_if_not_exist("WA_Players",&"isAdmin",&"INT(11)&NOT&NULL&DEFAULT&&'0'"); add_column_if_not_exist("WA_Auctions",&"created",&"INT(11)&NULL");function&add_column_if_not_exist($table,&$column,&$column_attr){&&&&$exists&=&&&&&$columns&=&mysql_query("show&columns&from&$table");&&&&while($c&=&mysql_fetch_assoc($columns)){&&&&&&&&if($c['Field']&==&$column){&&&&&&&&&&&&$exists&=&&&&&&&&&&&&&&&&&&&&&}&&&&}&&&&&&&&&&if(!$exists){&&&&&&&&mysql_query("ALTER&TABLE&`$table`&ADD&`$column`&&$column_attr");&&&&}}?&Please Help!
Warning: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given In /home/path/public_html/path/path/stats.php On Line 41
So I'm working for someone, and they want me to fix this error in a PHP file..
Here is the code:
&& &include_once('config.php');
&& &$online = mysql_query("SELECT * FROM bots WHERE status LIKE 'Online'");
&& &$offline = mysql_query("SELECT * FROM bots WHERE status LIKE 'Offline'");
&& &$dead = mysql_query("SELECT * FROM bots WHERE status LIKE 'Dead'");
&& &$admintrue = mysql_query("SELECT * FROM bots WHERE admin LIKE 'True'");
&& &$adminfalse = mysql_query("SELECT * FROM bots WHERE admin LIKE 'False'");
&& &$windows8 = mysql_query("SELECT * FROM bots WHERE so LIKE '%8%'");
&& &$windows7 = mysql_query("SELECT * FROM bots WHERE so LIKE '%7%'");
&& &$windowsvista = mysql_query("SELECT * FROM bots WHERE so LIKE '%vista%'");
&& &$windowsxp = mysql_query("SELECT * FROM bots WHERE so LIKE '%xp%'");
&& &$unknown = mysql_query("SELECT * FROM bots WHERE so LIKE 'Unknown'");
&& &$totalbots = mysql_num_rows(mysql_query("SELECT * FROM bots"));
&& &$onlinecount = 0;
&& &$offlinecount = 0;
&& &$deadcount = 0;
&& &$admintruecount = 0;
&& &$adminfalsecount = 0;
&& &$windows8count = 0;
&& &$windows7count = 0;
&& &$windowsvistacount = 0;
&& &$windowsxpcount = 0;
&& &$unknowncount = 0;
&&& while($row = mysql_fetch_array($online)){
&& &&&& $onlinecount++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($offline)){
&& &&& &$offlinecount++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($dead)){
&& &&&& $deadcount++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($admintrue)){
&& &&&& $admintruecount++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($adminfalse)){
&& &&&& $adminfalsecount++;
&& &while($row = mysql_fetch_array($windows8)){
&& &&&& $windows8count++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($windows7)){
&& &&&& $windows7count++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($windowsvista)){
&& &&&& $windowsvistacount++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($windowsxp)){
&& &&&& $windowsxpcount++;
&& &&& &&& & && &
&& &while($row = mysql_fetch_array($unknown)){
&& &&&& $unknowncount++;
&& &$statustotal&&& = $onlinecount + $offlinecount + $
&& &$admintotal&&&& = $admintruecount + $
&& &$sototal&&&&&&& = $windows7count + $windowsvistacount + $windowsxpcount + $
Can anyone tell me the error here, can how to fix it?
Php Warning:
File_exists() Expects Parameter 1 To Be String, Array Given
PHP Warning:
file_exists() expects parameter 1 to be string, array given in /home/mysite/public_html//wp-content/themes/mytheme/form.php on line 9
PHP Warning:
file_exists() expects parameter 1 to be string, array given in /home/mysite/public_html//wp-content/themes/mytheme/form.php on line 13
I have a form that is having some issues and in the error log I see a bunch of these warnings. What is wrong with this??
I numbered the offending lines below (lines 9 & 13)
Thanks for any help on this.
function CheckExistance($VUrl)
if ( file_exists($VUrl) )
elseif ( file_exists(str_replace('www.','', $VUrl)) )
echo str_replace('www.','', $VUrl);
echo str_replace('','www.', $VUrl);
Edited by damion, 02 July 2014 - 06:01 PM.
Mysql_num_rows() Expects Parameter 1 To Be Resource, Boolean Given
Hi guys,I'm new to forums so hopefully someone can help me.I keep getting the following error:Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\Blog2\checklogin.php on line 27My code is: Code: [Select]// Define $blog_user_name and $blog_user_password $blog_user_name=$_POST['blog_user_name']; $blog_user_password=$_POST['blog_user_password']; // To protect MySQL injection (more detail about MySQL injection)$blog_user_name = stripslashes($blog_user_name);$blog_user_password = stripslashes($blog_user_password);$blog_user_name = mysql_real_escape_string($blog_user_name);$blog_user_password = mysql_real_escape_string($blog_user_password);$sql=&SELECT * FROM $tbl_name WHERE username='$blog_user_name' and password='$blog_user_password'&;$result=mysql_query($sql);// Mysql_num_row is counting table row$count=mysql_num_rows($result);& //THIS IS LINE 27// If result matched $blog_user_name and $blog_user_password, table row must be 1 rowif($count==1){// Register $blog_user_name, $blog_user_password and redirect to file &index.php&session_register(&blog_user_name&);session_register(&blog_user_password&); header(&location:index.php&);}else {echo &Wrong Username or Password&;}ob_end_flush();Please can someone help I have know idea what the problem could be. Thanks.
Help! Mysql_num_rows() Expects Parameter 1 To Be Resource, Boolean Given...
The 2 errors I am getting a Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\searchstock2.php on line 36Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\searchstock2.php on line 38I am trying to search a table and return results, all fields are VARCHAR except ID (integer), her$link&=&mysql_connect("localhxxxxx","xxx","");&//(host,&username,&password)mysql_select_db("wadkin",&$link)&or&die("Unable&to&select&database");&//select&which&database&we're&using//&Build&SQL&Query&&$query&=&"select&*&from&stocklist&where&Stock&Number&like&\'%$trimmed%\'OR&Name&like&\'%$trimmed%\'&OR&Category&like&\'%$trimmed%\'";&&if&($numresults=mysql_query($query));&
$row&=&mysql_fetch_assoc($numresults);&&&&&if&($row['COUNT(*)']&==&0);&$numrows=mysql_num_rows($numresults);if&($numrows&==&0)&&{&&echo&"&h4&Results&/h4&";&&echo&"&p&Sorry,&your&search:&&"&.&$trimmed&.&"&&returned&zero&results&/p&";&&}//&Determine&if&s&has&been&passed&to&script,&if&not&use&0&&if&(empty($s))&{&&$s=0;&&}//&get&results&&$query&.=&"&limit&$s,$limit";&&$result&=&mysql_query($query)&or&die("Couldn't&execute&query");//&display&what&the&person&searched&forecho&"&p&You&searched&for:&&"&.&$var&.&"&&/p&";//&begin&to&show&results&setecho&"Results";$count&=&1&+&$s&;//&display&the&results&returned&&while&($row=&mysql_fetch_array($result))&{&&$title&=&$row["Name"];&&echo&"$count.)&$title"&;&&$count++&;&&}$row = mysql_fetch_assoc($numresults);& = line 36$numrows=mysql_num_rows($numresults); = line 38
Help With: Mysql_fetch_array() Expects Parameter 1 To Be Resource, Boolean Given

我要回帖

更多关于 expects parameter 1 的文章

 

随机推荐