473,325 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Query Error

chelvan
90
hi forums !
its me again.

here my code, that i struggles...

Expand|Select|Wrap|Line Numbers
  1.          $options=$_POST['options'];
  2.          $hf=$_POST['hf'];
  3.          $arr= count($options);
  4.          if ($options){
  5.             for ($i=0;$i<count($options);$i++){
  6.              $pos[$i]= strlen($options[$i]);
  7.                 $name[$i]=substr($options[$i],0,$pos[$i]);
  8.             echo  $name[$i];
  9.  
  10.         $sql_user=mysql_query("SELECT*FROM user WHERE username='$name[$i]'");
  11.         while($row=mysql_fetch_array($sql_user)){
  12.             echo $refno=$row['refno']."<br>";
  13.         }
  14.     }    
  15. }
  16.  

options[] is the name of my listbox. i able to pass it in to php thats print
Expand|Select|Wrap|Line Numbers
  1. echo  $name[$i];
  2.  
but the bellow query does not worked. i used the $name[$i] as where condition.


why any errors in the query?


thanks in advance
chelvan
Oct 30 '08 #1
3 1025
dlite922
1,584 Expert 1GB
do some debugging

do an echo on mysql_error()


Dan
Oct 30 '08 #2
r035198x
13,262 8TB
SELECT*FROM ... won't work. You need spaces.
Oct 30 '08 #3
chelvan
90
hi all

thanks all of your response.

please forgive me, i made a mad mistake on query on my where clause i checked different fields. now i correct that.


so much sorry. before post i tried to find nearly 2 days. but i couldn't. then finally i did.


any how thanks a lot.



regards
chelvan
Oct 30 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Polar | last post by:
I am having troubles finding the parse error in this script. I've been checking for weeks. I am too new to the subject I guess. I am trying to show a readord and them have a form at the bottom...
2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
3
by: Nick Truscott | last post by:
<? // scoreinput.php - input a match score when match selected from list ?> <html> <head> <basefont face="Verdana"> </head> <body>
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
1
by: anuragvatsa | last post by:
hi, how to write query to select project estimated effort,actual effort spent,%usage of project effort,%completion of project,ratio of %work completion to % effort consumed FOR 1. during the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.