this page edit page which record user want to edit that field come to the two box..


this is my coding but error is coming Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource


<?php

$jtitle=$_GET;
$desc=$_GET;

$hostname="localhost";
$username="cdf";
$password="dfdf";
$dbid="cdsemplo_job";
$link=mysql_connect($hostname,$username,$password);
mysql_select_db($dbid) or die("not connected");
$result=mysql_query("select * from job where jobtite=$jtitle");

while($row=mysql_fetch_row($result))
{
$j1=$row;
$j2=$row;
}

if(isset($_REQUEST))
{
mysql_query("UPDATE Person job jobtite = '$jtitle'");
}
mysql_close($link);
?>


<html>
<body align="center" left="20px" right="20px" bgcolor="#fffff">
<form method="post" action="edit.php">
<center>
<table>
<br>
<tr>
<center><tr>Employement Form</tr></center>
</tr>
<br>
</table>

<table border=0>
<tr><td> JobTitle </td><td><input type="text" name="jobname" value="<? echo $j1; ?>"></td></tr>
<tr><td> JobDescription </td><td><input type="text" name="jdesc" value="<? echo $j2; ?>"></td></tr>
<center><tr><td> </td><td><input type="submit" name=update value="Update" width="20"></td></tr></center>
</p>
</table>
</center>
</form>
</body>
</html>

The warning tells you the following: "Your query is *nuts*."

This is what you should do:
$result=mysql_query("select * from job where jobtite='".$jtitle."'");

And, mysql_fetch_row returns numeric indexes. Use, mysql_fetch_array or mysql_fetch_assoc instead.

P.S: Plz make it fast isn't the right way to post a thread in the forum :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.