Jump to content

stockton

Members
  • Posts

    319
  • Joined

  • Last visited

    Never

Everything posted by stockton

  1. My user has copied some of the tables within his Oracle database to a Access mdb file and now I need to get this data into my Oracle 10g database. Two of the tables included already exist on my database and there is also at lease one new table. I need pointers on how I should go about doing this. I have tried 3 different things using Apex(Oracle database express) but all failed.
  2. I was getting myself somewhat confused between type, name and value. Thank you, got it working now.
  3. I did not describe my problem and lack of understanding too well. I was lead to believe that $_REQUEST['submit'] would retrieve the value of the clicked button & if all buttons were defined with name='submit', as I have, one could retrieve the value by $_REQUEST['submit'] and therefore I should, when clicking the reset button, get the value "Reset" returned . As you can see above if I click submit button I get the value "Submit" returned but no such luck with the reset button. NB Look at the capital letters.
  4. I am having a problem retrieving which button was clicked in my PHP. The following is based on something I found on the internet. The PHP to retrieve the button is:- if (!empty($_REQUEST['submit'])) $Button = ($_REQUEST['submit']); else $Button = ''; but echo ("button = ".$Button); always displays:- button = Submit and the buttons are defined as follows:- <input type="submit" name="submit" value="Submit"> <input type="reset" name="submit" value="Reset"> Please tell me what I misunderstood.
  5. By the way feidakila, I do not believe that it makes much difference if the HTML is on top or the PHP. If anyone else has any others ideas I would appreciate hearing them.
  6. I have solved the problem and what PFMaBiSmAd said above covered most of the issues. Thank all.
  7. I am now convinced that it is a HTML issue not a PHP problem at all.
  8. I doubt that it is a configuration problem as $_REQUEST works fine in other scripts I have on the same machine.
  9. Tried your suggestion but still without success. I am not getting anything back.
  10. You said "I'm writing a web related program in PHP" and if you look at http://www.stockton.co.za/lb you should see something similar & if you are interested I could share the code with you.
  11. Yes, the form method="get" but from what I understand from the manual $_REQUEST should work for either method="post" or method="get"
  12. I have written the following and am confused as to why when the script reloads I cannot retrieve the html fields via $_REQUEST. Will someone please tell me what I have done silly. <?php require_once('includes/logo.inc'); require_once('includes/configuration.php'); // database connect script & the rest. /* * We 1st check if user has logged on and has the necessary authority. */ // echo ("Earn Rate Create at erate.php<br/>"); $Ding = $_REQUEST["submit1"]; $EarnRateTitle = $_REQUEST["EarnRateTitle"]; $SlotsRate = $_REQUEST["SlotsRate"]; echo "ding = ".$Ding." <br/>"; echo ("EarnRateTitle = ".$EarnRateTitle." SlotsRate = ".$SlotsRate."<br/>"); if ($_SESSION['UID'] < 1) // Not logged in { $Message = sprintf("%s %d <br> Logon to be able to access this task!", __FILE__, __LINE__); trigger_error($Message, E_USER_ERROR); exit; } if ($Ding == "") // 1st time display the screen { $Ding = 1; } else if ($Ding == 1) // Hopefully something got entered so do calculation { $Ding = 2; if (($EarnRateTitle == "") || ($SlotsRate == "")) { $Message = sprintf("%s %d <br> Please enter both fields!", __FILE__, __LINE__); trigger_error($Message, E_USER_ERROR); exit; } $RouletteRate = $SlotsRate*$TheoreticalHold[slots]/$TheoreticalHold[Roulette]; $BlackJackRate = $SlotsRate*$TheoreticalHold[slots]/$TheoreticalHold[blackJack]; $PuntoBancoRate = $SlotsRate*$TheoreticalHold[slots]/$TheoreticalHold[PuntoBanco]; $PokerRate = $SlotsRate*$TheoreticalHold[slots]/$TheoreticalHold[Poker]; echo ("Roulette = ".$RouletteRate." BlackJack = ".$BlackJackRate." PuntoBlance = ".$PuntoBlancoRate." Poker = ".$PokerRate); } else if ($Ding == 2) // Previous calculations accepted { } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <title>Earn Rate Create</title> <meta name="author" content="Alf Stockton"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="Mon, 22 Jul 2000 11:12:01 GMT"> </head> <body onload="BodyOnLoad()"> <h2>Create Earn Rate</h2> <form method="get" name="EarnRateCreate" id="EarnRateCreate" > <!-- action="<?php echo $PHP_SELF; ?> " > --> <TABLE BORDER CELLPADDING=3 align=center> <TR BGCOLOR="deeppink"> <TH>Description</TD> <TH>Slots</TD> <TH>Roulette</TD> <TH>BlackJack</TD> <TH>PuntoBanco</TD> <TH>Poker</TD> </TR> <TR BGCOLOR="#FFFFCC"> <TD><input type="text" name="EarnRateTitle" id="EarnRateTitle" size=20></TD> <TD><input type="text" name="SlotsRate" id="SlotsRate" size=10></TD> <TD><input type=text disabled name="RouletteRate" id="RouletteRate" size=10></TD> <TD><input type=text disabled name="BlackJackRate" id="BlackJackRate" size=10></TD> <TD><input type=text disabled name="PuntoBancoRate" id="PuntoBancoRate" size=10></TD> <TD><input type=text disabled name="PokerRate" id="PokerRate" size=10></TD> </TR> </table> <center> <input type=hidden name="submit1" id="submit1" value="<?php echo $Ding; ?>" > <P> <a href="erate.php"><img src=images/Submit.png name="submit" value="submit" border=0> <a href="erate.php"><img src=images/AddNew.png name="addnew" value="addnew" border=0> <a href="Administration.php"> <img src="images/Back.png" border=0> </a> </p> </center> </FORM> </body> </html> <script type="text/javascript"> function BodyOnLoad() { document.getElementById('EarnRateTitle').focus(); } </script>
  13. The following SQL returns ORA-00936 when run. select MemNumber, Turnover from ( select mem_number MemNumber, sum(trans_turnover) Turnover from members join transact on mem_number = trans_code where Trans_date between '&Start' and '&End' and mem_barred = 0 group by mem_number order by turnover desc ) where rownum <=200 / Please tell me how I fix it.
  14. I am attempting to create a table in an existing database using:- CREATE TABLE 'Users' ( 'UserNum' int(4) NOT NULL auto_increment, 'FirstName' varchar(20) NOT NULL default '', 'LastName' varchar(20), 'Usrname' varchar(10), 'Passwrd' varchar(15), 'AccessLevel' int NOT NULL default 0, 'last_login' datetime NOT NULL default '0000-00-00 00:00:00', 'UserID' int NOT NULL default 0, PRIMARY KEY ('UserNum') ) TYPE MyISAM AUTO_INCREMENT=1; and it fails with:- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Users' ('UserNum' int(4) NOT NULL auto_increment, 'FirstName' varchar(20) NOT N' at line 1 Please help.
  15. I get the following error message:- Warning: Cannot modify header information - headers already sent by (output started at /var/www/www.stockton.co.za/doc/pm/functions.php:32) in /var/www/www.stockton.co.za/doc/pm/login.php on line 50 The code that is at login.php line 50 is header("location:main.php"); and functions.php looks like:- <?php function checkformat($aUsername) { return TRUE; if(eregi('^[a-z]+[.]+[a-z]+$',$aUsername)) return TRUE; else return FALSE; } function checkmailformat($aEmail) { return TRUE; if(eregi('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+ $',$aEmail)) return TRUE; else return FALSE; }//end function function genpass() { $chars = "1234567890abcdefGHIJKLMNOPQRSTUVWxyzABCDEFghijklmnopqrstuvwXYZ1234567890"; $thepass = ''; for($i=0;$i<7;$i++) { $thepass .= $chars{rand() % 39}; } return $thepass; } ?> and for the life of me I cannot see where "headers already sent by" has occurred. Please help.
  16. Excellent, thank you. I would have looked at it for a year and still believe that 2,2 was two before and two after the decimal.
  17. I have setup the following table:- IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'theoreticalHold') DROP TABLE theoreticalHold GO CREATE TABLE THold ( pid int NOT NULL IDENTITY(1,1), TS NUMERIC(2,2) NOT NULL, TR NUMERIC(2,2) NOT NULL, TB NUMERIC(2,2) NOT NULL, TP NUMERIC(2,2) NOT NULL, TP2 NUMERIC(2,2) NOT NULL, filler1 NUMERIC(2,2) NOT NULL, filler2 NUMERIC(2,2) NOT NULL, filler3 NUMERIC(2,2) NOT NULL, PRIMARY KEY (pid) ); and now I am trying to execute the following insert statement in Enterprise Manager INSERT INTO theoreticalHold VALUES (5.40, 2.40, 1.00, 1.15, 2.40, 0,0,0); and it fails with Server: Msg 8115, Level 16, State 8, Line 1 Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated. I do not understand the necessity of converting numeric to numeric. Please tell me what I have done wrong.
  18. Is it possible to cause some text to appear relative to the top left of the browser window rather than the top left of its "container"? I have to modify an existing page and have tried adding the following to the CSS script:- .counterMT { position:fixed; top:3px; left:1px; } and tried using it via <class="counterMT"><font color=white><?php echo $NumMembersServed ?>Members Issued><br/>Tickets Issued = <?php echo $NumTicketsIssued ?></font> but this stays relative to its "container" rather than relative to the browsers window.
  19. On a clients Windows NT SRVEPAPPS01 5.2 build 3790 server we are running PHP Version 5.2.6 under Apache 2.0 and find that even though the server time is correct php reports/retrieves the time as one hour in the future. The phpinfo reports Default timezone Europe/Helsinki but in our php.ini we have [Date] ; Defines the default timezone used by the date functions date.timezone = SAST in other words South African Standard Time. Please tell me where I should look to repair this problem?
  20. I have created a small test script <?php echo date('Y-m-d H:i:s'); ?> and when I IE7 browse to it, it displays the date and time as expected but when I run it from the command line, with the command "php datetest.php" it fails with "The procedure entry point _zval_dtor could not be located in the dynamic link library php5ts.dll" Please tell me how to fix this.
  21. I need to retrieve a count of the number of records in a table. No problem..... SELECT COUNT(*) FROM TicketsIssued should do it however a column in this table is MemberNumber and there can be more than one record per MemberNumber. So I need to know how to code the following..... SELECT COUNT(*) FROM TicketsIssued WHERE MemberNumber ?UNIQUE? Suggestions please.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.