Jump to content

mysql_fetch_array():


monika

Recommended Posts

<?php

$Array["regno"] =trim ($Array["regno"]);

 

include("configresult.php");

 

$Link = mysql_connect($Host, $User, $Password);

$Query="SELECT * from $TableName Where regno= $Array[regno]";

$Result= mysql_db_query ($DBName, $Query, $Link);

 

if ($Row = mysql_fetch_array ($Result)){

print (" REG.No: $Row[regno]        Class: $Row[class] <br />NAME: $Row[firstname] <br /> Status: $Row[divs] <BR> ");

}

else {

echo '<font size="2" face="Tahoma" font color="#FF0000" font-weight:"Normal"> Sorry, Invalid Registration No! </font>';

}

mysql_close ($Link);

?>

 

------

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

.....on line 25

 

 

What's wrong with this code.. i'm unable to figure out... day ago it was working fine.

 

 

Link to comment
https://forums.phpfreaks.com/topic/64469-mysql_fetch_array/
Share on other sites

<FORM NAME="searchresults" METHOD="POST" ACTION="searchresults.php">

<table cellpadding="0" cellspacing="0" style="width: 396px; height: 1px">

<!-- MSTableType="layout" -->

<tr>

<td style="height: 16px">

                <div class="colum_right_border_bottom" style="width: 535px; height: 6px"> </div>

                    </td>

</tr>

</table>

<p align="center"><font face="Arial" style="font-size: 8pt"><strong>Search your

Examination Result</strong></font></p>

<p style="height: 98px"><font face="Verdana" style="font-size: 8pt">Enter your

Reg. No</font><font style="font-size: 8pt">.</font>

<input name="Array[regno]" type="text" id="Array[regno]" class="formbox" size="16"><BR>

<input type="submit" name="Submit" value="Submit" class="formbox"><br>

<font face="Arial" style="font-size: 8pt" color="#8A8A8A"><br>

Enter your Registration Number and press the Submit button.</font></p>

 

</FORM>

Link to comment
https://forums.phpfreaks.com/topic/64469-mysql_fetch_array/#findComment-321396
Share on other sites

<input name="regno" type="text" id="regno" class="formbox" size="16"><BR>

<input type="submit" name="Submit" value="Submit" class="formbox"><br>

 

------------------

 

<?php

$Array["regno"] =addslashes(trim($_POST["regno"]));

include("configresult.php");

 

$Link = mysql_connect($Host, $User, $Password);

$Query="SELECT * from $TableName Where regno= $Array[regno]";

$Result= mysql_db_query ($DBName, $Query, $Link);

 

if ($Row = mysql_fetch_array ($Result)){

print (" REG.No: $Row[regno]        Class: $Row[class] <p></P>NAME: $Row[firstname] <p></P> Status: $Row[divs] <BR> ");

}

else {

echo '<font size="2" face="Tahoma" font color="#FF0000" font-weight:"Normal"> Sorry, Invalid Registration No! </font>';

}

mysql_close ($Link);

?>

-----------

error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /searchresults.php on line 24

Sorry, Invalid Registration No!

Link to comment
https://forums.phpfreaks.com/topic/64469-mysql_fetch_array/#findComment-321411
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.