473,609 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

displayind data to textboxes from phpmyadmin

1 New Member
i have this code below and i want the details of the employees to be displayed when i click the 'search button' ..... the errors are :: - "Notice: Undefined variable: result in C:\xampp\htdocs \michael\sign.p hp on line 85

Warning: mysql_fetch_arr ay() expects parameter 1 to be resource, null given in C:\xampp\htdocs \michael\sign.p hp on line 85"


the code is as follows :

Expand|Select|Wrap|Line Numbers
  1. <?PHP
  2. $con = mysql_connect("localhost","root","");
  3. if (!$con)
  4.   {
  5.   die('Could not connect: ' . mysql_error());
  6.   }
  7. mysql_select_db("cdaleave", $con);
  8.  
  9.     if (isset($_GET['search'])){
  10.     $pno=isset($_GET['P_NO']) ? $_GET['P_NO'] : '';
  11.     $fname=isset($_GET['F_name']) ? $_GET['F_name'] : '';
  12.     $sname=isset($_GET['S_name']) ? $_GET['S_name'] : '';
  13.     $department=isset($_GET['Department']) ? $_GET['Department'] : '';
  14.     $password=isset($_GET['Password']) ? $_GET['Password'] : '';
  15.     $ldb=isset($_GET['Balance']) ? $_GET['Balance'] : '';
  16.     $dbf=isset($_GET['Forward']) ? $_GET['Forward'] : '';
  17.     $ela=isset($_GET['Allowance']) ? $_GET['Allowance'] : '';
  18.     $edr=isset($_GET['Resumption']) ? $_GET['Resumption'] : '';
  19.  
  20. $result = mysql_query("SELECT * FROM employee WHERE P_NO='$pno'");
  21. }
  22. while($row = mysql_fetch_array($result))........line 85
  23. {
  24.       echo "<input type='text' name='txtFname' value='".$row['F_name']."'>";
  25.    //... this is a section of indicating the other details to be displayed in the textboxes....// 
  26.  
  27. }
  28. mysql_close($con);
  29. ?> 
  30. </form>
  31. </body>

any assistance would be of great help to me

thanks in advance
Aug 18 '14 #1
1 1243
Dormilich
8,658 Recognized Expert Moderator Expert
that’s correct, if the search URL parameter is not given, $result will not be created, but you always try to loop over it.
Aug 19 '14 #2

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

Similar topics

0
2027
by: ghasem | last post by:
Dear all, Hello to all the great minds of php. My humble question is regarding the phpmyadmin. As you know the welcome screen of phpmyadmin allows one to choose the language. My question is this: if the data was entered into a database of mySQL in UNICODE, like "محمدان" and so fort, then how can we display this in a readable format when for example trying to Insert a new record from the phpmyadmin Insert option for the particular table?...
0
2512
by: leegold2 | last post by:
Can using PHPMyAdmin cause problems. What I'm doing is, I'm using PHPMyAdmi as a data entry tool. I create a new record in a table and then fill in the fields with the field editing and insert abilities of PHPMyAdmin. For a remote user of course I'd escape any inserted strings with addslashes or mysql_escape PHP functions. But I wouldn't do anything mailicious to my own DB so I'm just using PHPMyAdmin to insert, edit...anything. Are any...
0
6677
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL in there. However to do that you would need to be able to place the PHP file on the server, and I guess you probably can't do that either. Talk about catch 22... The only other way I can think of is to install MySQL on a machine you control, then import the data there using the method I...
3
3025
by: mojo jojo | last post by:
This may really be a phpMyAdmin problem, I think - but keen to hear your thoughts. Any help appreciated. Using phpMyAdmin to export an entire database works fine - I get a mydatabase.sql file. Restoring (using phpMyAdmin) usually work fine. However, if any of the data in any of the fields contains the '#' character, it bombs out citing a syntax error. I have tried escaping the character with '\' to no avail - still gives syntax errors.
0
2080
by: Golf Nut | last post by:
This is a phpmyadmin question more than anything, but I hope someone may be able to help. When creating a dump of a normalized database with 26 innodb tables, phpmyadmin export seems to only export the table structure/data in alphabetical order, rather than FK contraint order. Thus when importing the dump of the data, I need to manually go through and select the order to make sure the constraints hold up. Has anyone else seen this? I'm...
4
1744
by: Dave Moore | last post by:
Hi All, I'm putting a website together using PHP and a MySQL database. I've been using phpMyAdmin as it makes updating the DB nice and easy. For development, I've been using Apache, MySQL and PHP installed on my local machine but now I'm having problems porting to my hoster's server. To transfer the database contents, I've exported the structure and data of my local DB to a .sql file and uploaded this to my hosted DB using phpMyAdmin on...
2
6148
by: hph | last post by:
Please be gentle; I am a relative newbie for php/MySQL, and most of what I am doing is based on being self-taught using someone else's well-written code, and my own googling the answers to my questions. I'm doing a php/MySQL page that reads data out of a MySQL database. Longer term, I'll do a data-entry screen allowing me to modify the database or add new records. For now, I'm just using phpmyadmin to data enter stuff. Is there a way...
0
3466
by: NewbieSupreme | last post by:
I'm using PHPMyAdmin on an Apache2Triad install (latest version; 5.x.x, which installs PHP5 and PHPMyAdmin 2.8 as well). In Access, I exported a table to a text file, tab-delimited, text qualifyer of "none" (this is how I read to do it from newsgroups). When I use the Query window in phpmyadmin to import the text file, it waits a while, then returns an error: #1064 - You have an error in your SQL syntax; check the manual that...
2
6796
by: Victor | last post by:
Could anybody kindly point me to a clue in the following enigma : I have phpMyAdmin - 2.8.2.4 and MySQL - 4.1.13-nt. In the phpMyAdmin opened in any browser I am able to enter and store Russian characters in the DB; I cal also call the data back to display them in the phpMyAdmin. When I try to do the same from my own page, only some garbage with double as many characters as an original word gets stored in the DB (at least I see it...
9
4009
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New DataTable("SliceInfo") Dim tblSliceRatings As New DataTable("SliceRatings") '.... All the adding datacolumns, datarows, etc. goes here.. DatasetInit.Tables.Add(tblSliceInfo)
0
8534
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8509
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8188
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5502
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4002
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4059
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2502
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1630
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.