Results 1 to 3 of 3

Thread: i was strucked here

  1. #1
    Join Date
    Nov 2012

    i was strucked here

    hi Friends....

    i am trying to retrieve data from table by using check box values. but while running that program am getting tese following errors please let me know where i did the mistake!!!!!!
    here is my code
    $sql="select * from jobs where location=$hyd OR location=$bnglr OR location=$chni OR location=$pne OR location=$mbi OR location=$dli";
    echo "<form method='post'><table width='600px'>";
    while ($row=mysql_fetch_array($rtvl))
    echo "<tr><td><input type='checkbox' name='r".$j."' value='$row[1]'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href='just.php?id=".$row[2]."' style='color:blue' name='".$j."' target='_blank'>".$row['jobtitle']."</a>".$row['date']."</td></tr><tr><td>".$row['companyname']."</td></tr>

    echo "</table></form>";
    <form method="post"><table>
    <tr><td><input type="checkbox" name="hyd" value="hyderabad"/>Hyderabad</td></tr>
    <tr><td><input type="checkbox" name="bnglr" value="bangalore"/>Bangalore</td></tr>
    <tr><td><input type="checkbox" name="chni" value="chennai"/>Chennai</td></tr>
    <tr><td><input type="checkbox" name="pne" value="pune"/>Pune</td></tr>
    <tr><td><input type="checkbox" name="mbi" value="mumbai"/>Mumbai</td></tr>
    <tr><td><input type="checkbox" name="dli" value="delhi"/>Delhi</td></tr>
    <tr><td align="center"><input type="submit" name="refine1" value="Refine" /></td></tr>

  2. #2
    Join Date
    Mar 2009
    your question is not clear.
    try error_reporting(E_ALL); and mysql_error(); to find out the errors that may occur

  3. #3
    Join Date
    Aug 2004
    Please use this forum's [php]...[/php] bbcode tags around your code samples.

    If any/all of those values are strings, their variables will need to be single-quoted within your SQL.

    Note that your code is open to SQL injection attacks/errors due to those inputs not being escaped. Better yet: use the more up-to-date MySQLi or PDO extension with prepared statements and bound parameters in order to automatically handle input escaping where needed.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center