Current location: Hot Scripts Forums » Programming Languages » PHP » How to insert and to call out of mysql?


How to insert and to call out of mysql?

Reply
  #1 (permalink)  
Old 01-28-10, 04:03 AM
Cynthia21 Cynthia21 is offline
New Member
 
Join Date: Jan 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation How to insert and to call out of mysql?

Hiya,

I'm trying to include the output file (output.php) into a new webpage, but all the webbrowser shows is a blanc page, with any content. I don't get it...?

<?php include("output.php"); ?>

Any good soul out there knowing what's wrong?
All info is allready stored into the mysql database though...

here's the output.php code:

Code:
  1. <?
   2. $username="wsb1";
   3. $password="wsb2";
   4. $database="wsb3";
   5.  
   6. mysql_connect(localhost,$username,$password);
   7. @mysql_select_db($database) or die( "Unable to select database");
   8. $query="SELECT * FROM berichten ORDER BY titel DESC";
   9. $result=mysql_query($query);
  10.  
  11. $num=mysql_num_rows($result);
  12. $ret = mysql_query($query) or die(mysql_error());
  13. mysql_close();
  14.  
  15. $i=0;
  16. while ($i < $num) {
  17.  
  18. $taal=mysql_result($result,$i,"taal");
  19. $titel=mysql_result($result,$i,"titel");
  20. $auteur=mysql_result($result,$i,"auteur");
  21. $doc=mysql_result($result,$i,"doc");
  22. $datum=mysql_result($result,$i,"datum");
  23. $website=mysql_result($result,$i,"website");
  24. $nieuwsbrief=mysql_result($result,$i,"nieuwsbrief");
  25. $totdatum=mysql_result($result,$i,"totdatum");
  26. $inhoud=mysql_result($result,$i,"inhoud");
  27.  
  28.  
  29. echo
  30. "<br><h2><font face=Arial color=#3366FF>$titel</font></h2>
  31. <font face=Arial size=2 color=#999999>$inhoud</font></br>
  32. <br><i><font face=Arial size=1 color=#222222>$auteur</font></i></br>";
  33.  
  34. $i++;
  35. }
  36.  
  37. ?>
  38.  
  39. <? echo $variablename; ?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-28-10, 06:29 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
Put these lines at the beginning of the files, they should force any error messages to be displayed.

PHP Code:

<?php

ini_set
('display_errors',1);
error_reporting(E_ALL|E_STRICT);
...
Also, check the HTML tags at W3Schools Online Web Tutorials, some may be deprecated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 02:47 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.