•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,700 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,172 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1271 | Replies: 15
![]() |
•
•
Join Date: Mar 2007
Posts: 13
Reputation:
Rep Power: 2
Solved Threads: 0
Dear All;
I have table in vehicle.php file that contains vehicle information(plate number, vehicle model, reg. and exp. dates). I pprovided each record with href(more) if he want to know more about this specific vehicle in vehicle-info.php file. in vehicle-info.php I get the plateN and I pass it to the SQL command "Select * from $table where plateN = '$plateN';" However this was not working.
Can you guide me.
I attached my vehicle-info.php
Thanks alots...
I have table in vehicle.php file that contains vehicle information(plate number, vehicle model, reg. and exp. dates). I pprovided each record with href(more) if he want to know more about this specific vehicle in vehicle-info.php file. in vehicle-info.php I get the plateN and I pass it to the SQL command "Select * from $table where plateN = '$plateN';" However this was not working.
Can you guide me.
I attached my vehicle-info.php
Thanks alots...
•
•
Join Date: May 2006
Location: New Jersey
Posts: 1,422
Reputation:
Rep Power: 5
Solved Threads: 34
When you say it doesn't work what happens?
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
Join Date: May 2006
Location: New Jersey
Posts: 1,422
Reputation:
Rep Power: 5
Solved Threads: 34
What is the SQL error? That error message should tell you what is wrong and point you in the right direction towards fixing it.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
Join Date: Mar 2007
Posts: 13
Reputation:
Rep Power: 2
Solved Threads: 0
I put the condition as following
while($row = mysql_fetch_array($result));
echo"</table></div>";
}
else
echo "<p><i><b><font face=\"Chiller\" size=\"6\" color=\"#FF0000\">Sorry dear</font><font face=\"Chiller\" size=\"5\" color=\"#800000\">,
there is may be an error in our system, please contact us.</font></b></i></p>";
while($row = mysql_fetch_array($result));
echo"</table></div>";
}
else
echo "<p><i><b><font face=\"Chiller\" size=\"6\" color=\"#FF0000\">Sorry dear</font><font face=\"Chiller\" size=\"5\" color=\"#800000\">,
there is may be an error in our system, please contact us.</font></b></i></p>";
I took a look at the code and the only things I can see is to check the spelling (case sensitive) of the Index in your $_GET array.
Personally I would change the if statement. check if your result variable contains any data, and move your fetch array down into the if block. Than add a mysql_error(); to your error at the end. This way if your query fails it will tell you what happened so you can fix it. As well I would enclose the code of your else statement in { and } to ensure proper processing. Otherwise evan when it works it will possibly show your error.
I.E.
After you do that if you still have errors, they should be more detailed and we will be able to help you out furthur.
Personally I would change the if statement. check if your result variable contains any data, and move your fetch array down into the if block. Than add a mysql_error(); to your error at the end. This way if your query fails it will tell you what happened so you can fix it. As well I would enclose the code of your else statement in { and } to ensure proper processing. Otherwise evan when it works it will possibly show your error.
I.E.
$result = mysql_query($sql);
if ($result)
{
$row = mysql_fetch_array($result);
... (Rest of code)
}
else
{
...error code here...
mysql_error();
}
After you do that if you still have errors, they should be more detailed and we will be able to help you out furthur.
Last edited by GliderPilot : May 2nd, 2007 at 10:55 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- Modify Record script doesn't add/change info (PHP)
- Help with a reservation program! GUI Messed XD (Java)
- how willl i be able to save a specific record into my database file in ms access (Java)
Other Threads in the PHP Forum
- Previous Thread: Undifined Index in PHP code
- Next Thread: mysql_query(): supplied argument is not a valid MySQL-Link



Linear Mode