473,395 Members | 1,442 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,395 software developers and data experts.

getting variable from a form

2
i'm having a problem with my script ... anybody pls help. i'm new in php

i want to use following url

http://www.sanha.org.za/view1.php?id=1

the id=number part to search in database for its values and display online. i have the following script for view1.php

<?php

include(connect.php)

$id = $_GET['id'];
$search1 = "SELECT * FROM certified WHERE $id = 'certified.id'";
$result = mysql_query($search1);

while ($row = mysql_fetch_array($result))
{
echo $row["CompanyName"];
echo "<br>";
}
?>

the script returns empty. what wrong am i doing ????
Nov 14 '06 #1
3 1146
Nert
64
http://www.sanha.org.za/view1.php?id=1

the id=number part to search in database for its values and display online. i have the following script for view1.php

<?php

include(connect.php)

$id = $_GET['id'];
$search1 = "SELECT * FROM certified WHERE $id = 'certified.id'";
$result = mysql_query($search1);

while ($row = mysql_fetch_array($result))
{
echo $row["CompanyName"];
echo "<br>";
}
?>

the script returns empty. what wrong am i doing ????

hi,

ahmmn i found something wrong in your code i guess! maybe the column $id in your query statement is wrong because you have already declaired a variable $id before your query having the value from $_GET.

i'll make a small changes on your code and try it, maybe this will help you.

<?

include("connect.php");

$id = $_GET['id'];
$search1 = "SELECT * FROM certified WHERE id = '$id'";
$result = mysql_query($search1);

while ($row = mysql_fetch_array($result)) {
echo $row["CompanyName"];
echo "<br>";
}

?>


--nert
Nov 14 '06 #2
jaf
2
[quote=Nert]hi,

ahmmn i found something wrong in your code i guess! maybe the column $id in your query statement is wrong because you have already declaired a variable $id before your query having the value from $_GET.

i'll make a small changes on your code and try it, maybe this will help you.

thanx man, saved my day.... :)
Nov 15 '06 #3
Nert
64
[quote=jaf]
hi,

ahmmn i found something wrong in your code i guess! maybe the column $id in your query statement is wrong because you have already declaired a variable $id before your query having the value from $_GET.

i'll make a small changes on your code and try it, maybe this will help you.

thanx man, saved my day.... :)
hi,

always welcome...(^_^)


--nert
Nov 16 '06 #4

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

Similar topics

3
by: Jason | last post by:
hello, i am new to PHP, so go easy. I am using the examples in the book: PHP: Your Visual Blueprint For Creating Open Source, Server Side Content In the section where they talk about...
18
by: lawrence | last post by:
If I'm pretty sure there is just one form on the page, can i do this? var myForm = document.forms; If I'm not sure about the form, is it safer to do this? if (document.forms) { var myForm =...
4
by: gimme_this_gimme_that | last post by:
Hi, This is sort of a : How to build a Yes/No dialog box qquestion. Or perhaps a question about getting javascript variables from a pop-up window and processing them on a submit. This is...
8
by: Susan Bricker | last post by:
Hi. I am opening a form (frmUserSettings) just before (or so I thought) the Main Menu form (frmMainMenu) is opening but it's not getting the focus. It gets "painted" and then the Main Menu gets...
5
by: Thelma Lubkin | last post by:
I have a form/subform with the common one-to-many relationship. The form allows user to display records and move to other records via the selector, to add,delete, and edit them, with the related...
5
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
11
by: David Veeneman | last post by:
I need to get a parent's private variable from within a control. Here's what I'm doing: I have a control that I want to be able to detect the presence of a particular (System.ComponentModel)...
7
by: pooba53 | last post by:
I am working with VB .NET 2003. Let's say my main form is called Form1. I have to launch a new form (Form2) that gathers input from the user. How can I pass variable information back to Form1...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
2
DonRayner
by: DonRayner | last post by:
This one has me stumped. I'm getting a "Type Mismatch" error on one of my forms when it's being opened. It's hapening before the forms "On Open" event, I stuck a msgbox in there to check and I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.