home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / WIN95 / INTERNET / h12395co.exe / data.1 / sqlquery.hei < prev    next >
Encoding:
Text File  |  1997-11-05  |  1.6 KB  |  55 lines

  1. <include layout/heilay.hei>
  2.  
  3. <heitmlpage title="SQL Form" banner="banner3.gif">
  4.  
  5.  
  6. Now you can enter an arbitrary SQL-Query on our example database. Here are a few variations on the SELECT command that you might like to try:
  7.  
  8. <p>
  9.  
  10. <box>
  11.  
  12. <FONT SIZE="-1"><b>
  13.  
  14. <ul>
  15.  
  16. <li>  SELECT * FROM guestbook 
  17.  
  18. <li>  SELECT Guest_Name FROM guestbook ORDER BY Guest_Name
  19.  
  20. <li>  SELECT DISTINCT  Guest_Name, Email, Address FROM guestbook ORDER BY Guest_Name 
  21.  
  22. <li>  SELECT COUNT (*) FROM guestbook
  23.  
  24. <li>  SELECT COUNT (*) FROM guestbook WHERE Country="USA"
  25.  
  26. <li>  SELECT * FROM guestbook WHERE Guest_Name LIKE 'R%'
  27.  
  28. </ul>
  29.  
  30. </FONT></b>
  31.  
  32. </box>
  33.  
  34. <p>
  35.  
  36. Watch how the Query Result changes depending on the form of the SELECT command that you enter. 
  37.  
  38.  
  39.  
  40.  
  41.  
  42. /******************************************************************
  43.  
  44.  Here is the input form that allows the user to enter
  45.  
  46.  an SQL query.
  47.  
  48.  *****************************************************************/
  49.  
  50. <FORM ACTION="sqlquery.hei" METHOD=GET>
  51.  
  52. <INPUT TYPE="submit" VALUE="Query" NAME=Squery> 
  53.  
  54. <INPUT TYPE="reset"  VALUE="Reset"> 
  55.  
  56. <sa href="tutor1.hei"> Back </sa>
  57.  
  58. <br>
  59.  
  60.  
  61.  
  62. <TEXTAREA NAME="query" ROWS=6 COLS=55 wrap="physical"><
  63. if isempty(ff.query)>
  64. SELECT * FROM guestbook 
  65.  
  66. <else><? ff.query></if></TEXTAREA>
  67.  
  68. <br>
  69.  
  70.  
  71.  
  72. Format: 
  73.  
  74. <select name="format" size=1>
  75.  
  76. <option value="table">        as table 
  77.  
  78. <option value="record">       as record 
  79.  
  80. </select>
  81. <sessionhidden>
  82. <br>
  83.  
  84. </FORM>
  85.  
  86. /*************** End of SQL query input FORM ************/
  87.  
  88.  
  89.  
  90. </b>
  91.  
  92.  
  93. <if !isempty(ff.Squery)>
  94.    <include>f<? ff.format>.hei</include>
  95. </if>
  96.  
  97. </heitmlpage>
  98.  
  99.