473,505 Members | 16,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using echo for a table produces blank page, not even errors!!!?

2 New Member
Hi, I have a hyperlink which goes to the page below and passes the PK_ID from a query into 'userid'. From this we query the DB and then echo a table with a form; only the textboxes are already populated with the data from the query (in theory)!!!

But I get a blank page! I have error reporting on php and mysql but nothing is displayed?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. echo "<form method=\"post\" action=\"\" style=\"padding-left: 10px\">";
  4.  
  5. ini_set('display_errors','On');
  6. error_reporting(E_ALL);
  7.  
  8. $user = $_GET['userid'];
  9.  
  10. include 'config.php';
  11. include 'opendb.php';
  12.  
  13. $query = "select * from users WHERE user_id LIKE '$user'"; 
  14.  
  15. $result = mysql_db_query("servicemgmt", $query . mysql_error());
  16.  
  17. $r = mysql_fetch_array($result);
  18.  
  19. $firstname = $r['user_fname'];
  20. $lastname = $r['user_lname'];
  21. $ext = $r['user_ext'];
  22. $bleep = $r['user_bleep'];
  23. $exttel = $r['user_extno'];
  24. $email = $r['user_email'];
  25.  
  26.  
  27. echo "<table style=\"width: 80%\">";
  28. echo "<tr><td>First Name</td><td><input type=\"text\" value=\"$firstname\" name=\"firstname\" id=\"firstname\" style=\"width: 160px\"/></td><td>Last Name</td><td> <input type=\"text\" value=\"$lastname\" name=\"lastname\" id=\"lastname\" style=\"width: 160px\"/></td></tr>";
  29. echo "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
  30. echo "<tr><td>Extension</td><td> <input type=\"text\" value=\"$ext\" name=\"ext\" id=\"ext\" style=\"width: 160px\"/></td><td>Bleep No.</td><td> <input type=\"text\" value=\"$bleep\" name=\"bleep\" id=\"bleep\" style=\"width: 160px\"/></td></tr>";
  31. echo "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
  32. echo "<tr><td>External Tel.</td><td><input type=\"text\" value=\"$exttel\" name=\"exttel\" id=\"exttel\" style=\"width: 160px\"/></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
  33. echo "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
  34. echo "<tr><td>Email</td><td><input type=\"text\" value=\"$email\" name=\"email\" id=\"email\" style=\"width: 200px\" /></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
  35. echo "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
  36. echo "<tr><td><input name=\"updateuser\" type=\"submit\" id=\"updateuser\" value=\"Update User Details\" /></td><td>&nbsp;</td><td>&nbsp;</td><td><input name=\"reset1\" type=\"reset\" value=\"Clear Form\" /></td></tr>";
  37. echo "</table>";
  38.  
  39. echo "</form>";
  40.  
  41. ?>
Aug 15 '07 #1
4 1998
pbmods
5,821 Recognized Expert Expert
Heya, Rawky. Welcome to TSDN!

Try adding this after line 15:
Expand|Select|Wrap|Line Numbers
  1. echo mysql_error();
  2.  
Aug 15 '07 #2
rawky1976
2 New Member
Thanks, it's still blank, here's the calling page: -

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  
  3. error_reporting(E_ALL);
  4. ini_set('display_errors', '1');
  5.  
  6. include 'config.php';
  7. include 'opendb.php';
  8.  
  9. $edituser = $_POST['edituser'];
  10.  
  11.  
  12. $search = $_POST['edituser'];
  13. if ($search) // perform search only if a string was entered. 
  14. $srch="%".$search."%"; 
  15. $query = "select * from users WHERE user_sname LIKE '$srch'"; 
  16.  
  17. $result = mysql_db_query("servicemgmt", $query . mysql_error());
  18.  
  19. if ($result) 
  20. echo "Names matching query: -<br><br>";
  21. echo "<table width=90% align=left border=0>";
  22. while ($r = mysql_fetch_array($result)) { 
  23. $sn = $r["user_sname"];
  24. $fn = $r["user_fname"];
  25. $id = $r["user_id"]; 
  26. echo "<tr><td width=\"100%\"><a href=\"editSearcheduser.php?userid=$id\">$sn $fn</a></td></tr>";
  27. //echo "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>"; 
  28. }
  29. echo "</table>"; 
  30. } else { echo "problems...."; } 
  31. } else { 
  32. echo "Search string is empty. <br> Go back and type a string to search"; 
  33. }
  34.  
  35. include 'closedb.php';
  36.  
  37. ?>
Aug 15 '07 #3
pbmods
5,821 Recognized Expert Expert
Heya, Rawky.

This line confuses me:
Expand|Select|Wrap|Line Numbers
  1. $result = mysql_db_query("servicemgmt", $query . mysql_error());
  2.  
I don't understand why you are appending the result of mysql_error() to $query.
Aug 15 '07 #4
Purple
404 Recognized Expert Contributor
Hi,

try doing :

[PHP]echo $query;[/PHP]

and copying the query and running it directly in whatever database gui you have installed..

Let us know if that works ok cause we are then back to the code..

Regards Purple
Aug 15 '07 #5

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

Similar topics

1
1878
by: Kragspire | last post by:
I have some code that I would like to be able to print out a first name on a new page of paper each time it runs. The problem I have is when it reaches the end of the printing it produces a blank...
1
1071
by: antonin.jelinek | last post by:
Got a strange problem last night - after building new page using Master pages I tried to view the page in browser (using standard F5 run) but all I got was blank page. The strange thing is that...
1
4792
by: Randell D. | last post by:
Folks, I consider myself well versed with Apache 1.3 and PHP4 - I found drupal and wanted to try it out - I had problems getting it working with Apache2/PHP5/MySQL5 so I downgraded... Note: I...
25
3085
by: Jon Slaughter | last post by:
I have some code that loads up some php/html files and does a few things to them and ultimately returns an html file with some php code in it. I then pass that file onto the user by using echo. Of...
4
2934
by: rdfijn | last post by:
I tried to combine some stuff from Eric Meyer and Stu Nicholls to create a webpage layout. First try: http://www.dse.nl/~rodney/index.html It validates, but for some reason in IE7 only a...
1
925
by: =?Utf-8?B?cGF0dHk=?= | last post by:
I posted a question in Office 2007, around June 26 or so. I got a notification on Hotmail on June 28 that I had an answer. I clicked the link, but all I get is a blank page. Is there something...
18
2685
by: dreamy | last post by:
This is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>...
7
7111
by: rshgeneral | last post by:
I am having difficulty uploading some large files using php/html form. The code has worked for file sizes up to 23MB. When I've tried a 50MB file, i get a blank page instead of my confirmation echo...
0
7218
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
7370
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...
1
7021
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
7478
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...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4701
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...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
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 ...

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.