RE: [PHP-DB] Update data problem

2004-06-23 Thread Justin.Baiocchi
Ok, I was trying to keep it simple :), but here goes: In essence the problem is that (at the end of the script) income_out is coming out as just $option_close_price and not the intended $option_close_price*$no_sold, and profit_loss is coming out as just -$option_close_price and not the intended $in

Re: [PHP-DB] Update data problem

2004-06-23 Thread Sam Chill
Justin, Is the code you posted all of the code or just a small snippet? You don't appear to be setting $C or $G. Could you post a larger code dump please? -Sam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Update data problem

2004-06-23 Thread Justin.Baiocchi
Sam, I have changed it but the result is still the same: Basically I am getting $E = $C , it seems that it is not picking up the value of $G (and there is a value of 500 in there and it is the only row of data). -Original Message- From: Sam Chill [mailto:[EMAIL PROTECTED] Sent: Thursd

Re: [PHP-DB] Update data problem

2004-06-23 Thread Sam Chill
$E= "$C*$G"; Should be: $E = $C * $G; Never use quotation marks when doing math. Quotation marks are used for strings. Hope that helps. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Update data problem

2004-06-23 Thread Justin.Baiocchi
Hi there, I hoped someone might be able to tell me why this is not working. I have a form that updates the table 'media' with the 3 values below, that and some other variables are the only data in the table. That works nicely. I then want to update one of the other columns ($E) based on the

Re: [PHP-DB] value error in PHP form

2004-06-23 Thread Zachary Krakov
The reason for this is due to the variable "$action" not having any relation to the action. Therefore, you should use the following if/then statement: if ($submit !== '') { // STATEMENTS } The "submit" name/value pair variable passed via your form is a named variable that possesses the value

Re: [PHP-DB] value error in PHP form

2004-06-23 Thread Zachary Krakov
Hi Rinku, One problem I see is that the HTML tags appear to be off... Your HTML is improperly formatted, which could be causing rendering anomalies to occur, in addition to the register globals issue which I'll mention shortly. Please correct your HTML code to read: YOUR_PAGE_TITLE_HERE HTML_B

Re: [PHP-DB] Re: problem....

2004-06-23 Thread Philip Thompson
I may be incorrect, but I do not think that by "redefining" the variable $pic is destroying its old contents. If you are familiar with how programming works, you realize that the "stuff" on the right side of the "=" sign is evaluated first, and then assigned to the left side of the "=" sign. Be

Re: [PHP-DB] SQL help

2004-06-23 Thread Gabe
I have tried that and I don't get an error, but I don't get any records returned either. And I have lowered the search string like you mentioned. Here's what I tried ( Access syntax ): SELECT autoQuesID,fldQuesTitle,fldBody FROM tblFAQ_Question WHERE LCase(fldBody) LIKE '%$strSearchFor%'; Nic

Re: [PHP-DB] Re: problem....

2004-06-23 Thread Cole S. Ashcraft
Kim, Won't redefining the variable destroy the MySQL Resource, resulting in a resource invalid error, like he has? $pic = mysql_query($sql,$connection); //Defines variable $pic //Redefining variable, dumps old contents = //calling on an invalid MySQL Resource, because it doesn't exist mysql_fetch

[PHP-DB] Re: problem....

2004-06-23 Thread Kim Steinhaug
Well, your query looked confusing to me, but break it up like this First : select Then, name your coloumns, seperate with commas, or use wildcard for all * Define from what table you need to select FROM database_table Add some select statements with WHERE WHERE and the statements i

RE: [PHP-DB] SQL help

2004-06-23 Thread Swan, Nicole
Have you tried lowering the fldBody as well? Like: SELECT autoQuesID,fldQuesTitle,fldBody FROM tblFAQ_Question WHERE LOWER(fldBody) LIKE '%$strSearchFor%'; And $strSearchFor has already been lowered, of course. --Nicole --- Nicole Swan Web Programming Specialist Carroll C

[PHP-DB] SQL help

2004-06-23 Thread Gabe
I'm using PHP with ADOdb ( and an MS Access 2000 db ) to write a simple SQL statement but was running into some case sensitivity issues. Here's my SQL currently: SELECT autoQuesID,fldQuesTitle,fldBody FROM tblFAQ_Question WHERE fldBody LIKE '%$strSearchFor%'; All I'm trying to do is have the us

Re: [PHP-DB] problem....

2004-06-23 Thread Jonathan Haddad
Please post the table definition to the mailing list so we can help you more quickly. Also, is there a table called RuneRunner_1 or are you meaning to use RuneRunner_1 as an alias? Odds are, your problem is not PHP related, it's an error in your SQL syntax. Jon water_foul wrote: i fixed those t

Re[2]: [PHP-DB] problem....

2004-06-23 Thread Pablo M. Rivas
Hello water_foul, what about this? If you do for the first time: $pic=mysql_fetch_array($pic) it will work, but the SECOND TIME that you do: $pic=mysql_fetch_array($pic) it will fail, and thats because $pic is no longer a resource identificator... and you will get: > >

RE: [PHP-DB] problem....

2004-06-23 Thread Hutchins, Richard
Haven't seen that this has been solved yet so I thought I'd throw my two cents into the fray. First of all, I'd second the earlier suggestion that you assign your query to a variable. And, second, I'd recommend that you echo out your query to the browser just before it is submitted to the database

Re: [PHP-DB] Value Error in execution

2004-06-23 Thread jeffrey_n_Dyke
>Dear all, >Can you aswer for the Query as follow : >if(isset(_POST['VARIABLE1']$$(_POST['VARIABLE2']) >{>print "testing"; >STATEMENTS; >} I'm not sure how this is not throwing a fatal error. Why do you have two $'s in the middle and no $ preceeding variable names? does this work? if(isset($

[PHP-DB] Value Error in execution

2004-06-23 Thread Rinku
Dear all, Can you aswer for the Query as follow : if(isset(_POST['VARIABLE1']$$(_POST['VARIABLE2']) { print "testing"; STATEMENTS; } Here, even I havent set the value for the variables then even I am getting the output like "testing". Can any of you suggest me the sollution for the query

[PHP-DB] Re: Multiple Inserts

2004-06-23 Thread Achieve IT
Solved... I needed to find a way to get the latest auto_increment value. I did this using, $new_id = mysql_insert_id(); Thanks, Declan. Thanks for the suggestions. I have $TimeSheetID=$_POST['TimeSheetID']; at the start of the script. However, what I neglected to

Re: [PHP-DB] adding a mysql query as text into a history table... ?

2004-06-23 Thread Gawie Marais
thanx guys. "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wednesday 23 June 2004 17:14, Gawie Marais wrote: > > > i would like to add the whole query into a text field in the 'history' > > table, but i get errors when i try to add it... can anyone help ? > > > > th

Re: [PHP-DB] Multiple Inserts

2004-06-23 Thread Achieve IT
Thanks for the suggestions. I have $TimeSheetID=$_POST['TimeSheetID']; at the start of the script. However, what I neglected to mention is that TimeSheetID is auto_increment, in first table, tblTimesheet. I will try the other suggestions, and respond with my results. Thanks, Declan. -

Re: [PHP-DB] adding a mysql query as text into a history table... ?

2004-06-23 Thread Jason Wong
On Wednesday 23 June 2004 17:14, Gawie Marais wrote: > i would like to add the whole query into a text field in the 'history' > table, but i get errors when i try to add it... can anyone help ? > > this is the error :- > > Invalid query: You have an error in your SQL syntax near '2004-06-23 > 11:0

[PHP-DB] adding a mysql query as text into a history table... ?

2004-06-23 Thread Gawie Marais
hi guys, i have created a 'history' table and would like to insert the 'bare' sql query into that table just to check who did what on the database... now, i have this :- $CustUpdate = "INSERT INTO record SET recid = '', customer_code = '$varCustomerCode', id_reg = '$varId

[PHP-DB] Re: Multiple Inserts

2004-06-23 Thread Rui Cunha
some tips when inserting data: instead of inserting into the the table, do some debugging,echo the insert string and check if: 1- all string fields are between single comma ('field_name').Numéric fields do not need single comma; 2- all not null fields are present in the field list; 3- you're

Re: [PHP-DB] problem....

2004-06-23 Thread David Robley
Water_foul wrote: > i fixed those things and it didn't fix it :( :( :( :( :( :( :( :( :( is > there a icq chatroom for php?) > "Shahmat Bin Dahlan" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Your SQL statement: >> >> 'SELECT Rune, username FROM RuneRunner >> RuneR