[PHP-DB] Re: Addslashes
It's the magic quotes setting. Try setting magic_quote_gpc to off. Also, try turning magic_quotes_runtime off. Ng Hwee Hwee wrote: hi all, i'm really buffled by what i got and would appreciate any help possible! although i addslashes and stripslashes, i still get a backslash ( \ ) character infront of a single inverted comma ( ' ) and also whenever an amberscend ( & ) appears... please help! thanx thanx.. for example: in my form (form.php), i have something like that: "> upon submitting the form, the verification file (verify.php) will be executed, and it has lines like that: foreach($_POST as $varname => $value) $form[$varname] = addslashes(trim(EscapeShellCmd($value))); ?> ... and then i'll check for the validity of field1. if there is an error, the user will be redirected back to form.php with the value that the user entered echoed with a stripslash. if there is no error, the whole script runs well, but if the user has to be brought back to form.php, it'll print backslashes infront of characters like "( ) ' &" etc.. also, instead of having a blank text field, i have a text field with contents retrieved from the database.. the database data does not have the slashes and when the first time they appear on the screen, there is no slashes attached too.. the problem is always when the user has an error and needs to be brought back to form.php that the slashes appear and the number of slashes doubles everytime the user has to be brought back to form.php. i have my magic_quotes_gpc set to ON in my phpinfo() and my version of php is 4.1.2. thank you soo soo much!! look forward to your replies. hwee -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Addslashes
hi all, i'm really buffled by what i got and would appreciate any help possible! although i addslashes and stripslashes, i still get a backslash ( \ ) character infront of a single inverted comma ( ' ) and also whenever an amberscend ( & ) appears... please help! thanx thanx.. for example: in my form (form.php), i have something like that: "> upon submitting the form, the verification file (verify.php) will be executed, and it has lines like that: $value) $form[$varname] = addslashes(trim(EscapeShellCmd($value))); ?> ... and then i'll check for the validity of field1. if there is an error, the user will be redirected back to form.php with the value that the user entered echoed with a stripslash. if there is no error, the whole script runs well, but if the user has to be brought back to form.php, it'll print backslashes infront of characters like "( ) ' &" etc.. also, instead of having a blank text field, i have a text field with contents retrieved from the database.. the database data does not have the slashes and when the first time they appear on the screen, there is no slashes attached too.. the problem is always when the user has an error and needs to be brought back to form.php that the slashes appear and the number of slashes doubles everytime the user has to be brought back to form.php. i have my magic_quotes_gpc set to ON in my phpinfo() and my version of php is 4.1.2. thank you soo soo much!! look forward to your replies. hwee
Re: [PHP-DB] character problem with mssql
hi, i had the same problem a while ago with japanese characters. are you using a turkish OS or turkish application to insert your data? for me, what happened was i was given a file from a colleague who was using japanese OS and japanese version of excel. when he passed me the data, i opened it in Win2000 english version and edited the data with Excel2000 english version. when i save the file in a .csv format, i think the japanese characters got corrupted cos when i uploaded the file to PHPMyAdmin, i get ?? instead of my jap characters. but when my colleague tried on his machine with all the japanese settings, it worked well and good.. once the data is inside, any one can read it with the characters .. reading has never been a prob.. to what i experienced, the OS and the application may solve your prob. hth hwee - Original Message - From: "Gamze Başaran" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 03, 2003 9:38 PM Subject: [PHP-DB] character problem with mssql > Hi; > > I use php and mssql. I have got a character problem. I must use turkish > chracters. When I select datas from database it works true and I can see > turkish characters but when I want to insert new datas to database it set > wrong character. > > For example "Şİ" characetrs look like "?" How can I solve this problem? My > data type is char 100. > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] I 'am not so goooood with php....
** Low Priority ** 0) {echo ""; echo ""; echo $row_rsSubGroup['name']; echo ""; if $tel == $dbrows{ echo ""; } } else { echo ""; echo $row_rsSubGroup['name']; echo ""; echo ""; } $tel +=1; ?> I think you want to replace if $tel == $dbrows with if ($tel == $dbrows). -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] calculations using variables in html table cell
If you have to build complex, dynamic tables, do yourself a favour and use a class that will allow you to feed directly arrays of numbers. I use PEAR HTML_Table, which is great and easy to use. You will have recouped the investment of learning the class after about one hour. HTH Ignatius _ - Original Message - From: "Christopher Adams" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 03, 2003 21:07 Subject: [PHP-DB] calculations using variables in html table cell > I am generating html tables dynamically. Each table has multiple columns > and various calculations need to be done on each column and displayed > at the bottom of the column. I am including the code from one table below. > The $tablerow generates the table data and the $tablefooter generates the > rows at the bottom that will include the calculated values. > > Preceding the $tablerow declaration, I have declared some variables and done > calculations. I then included these > in the $tablefooter to display the calculated values. This works fine. > However, I have many other calculations on other columns in other tables. > Using this method, I would have to declare many new variables just for > calculations. > > > I am wondering if there is a way to do these calculations directly in the > table cells. I am pretty new to PHP and have not used calculations much. > > $sumpop += $POP; > $sumadultcirc += $ADULTCIRC; > $sumjuvcirc += $JUVCIRC; > > $tablerow[1] = "" . $row["name"] . "" . > "$POP$ADULTCIRC > $JUVCIRC$TOTCIRC$CIRCPERCAP$TOTREF$R > EFPERCAP"; > > > $tablefooter[1] = "Table total$sumpop > $sumadultcirc$sumjuvcirc$TOTCIRC< > /td> > $CIRCPERCAP$TOTREF$refpercap > > Table average or per capita$POPAV > $ADCIRCAV$JUDCIRCAV$TOTCIRCAV > > $CIRCPERAV$TOTREFAV$REPERAV"; > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] calculations using variables in html table cell
I am generating html tables dynamically. Each table has multiple columns and various calculations need to be done on each column and displayed at the bottom of the column. I am including the code from one table below. The $tablerow generates the table data and the $tablefooter generates the rows at the bottom that will include the calculated values. Preceding the $tablerow declaration, I have declared some variables and done calculations. I then included these in the $tablefooter to display the calculated values. This works fine. However, I have many other calculations on other columns in other tables. Using this method, I would have to declare many new variables just for calculations. I am wondering if there is a way to do these calculations directly in the table cells. I am pretty new to PHP and have not used calculations much. $sumpop += $POP; $sumadultcirc += $ADULTCIRC; $sumjuvcirc += $JUVCIRC; $tablerow[1] = "" . $row["name"] . "" . "$POP$ADULTCIRC $JUVCIRC$TOTCIRC$CIRCPERCAP$TOTREF$R EFPERCAP"; $tablefooter[1] = "Table total$sumpop $sumadultcirc$sumjuvcirc$TOTCIRC< /td> $CIRCPERCAP$TOTREF$refpercap Table average or per capita$POPAV $ADCIRCAV$JUDCIRCAV$TOTCIRCAV $CIRCPERAV$TOTREFAV$REPERAV"; -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Remote DB Connection
Hello Omelin, Wednesday, December 3, 2003, 6:05:52 PM, you wrote: OM> @mysql_connect ('ipaddres-server2', 'DBName', 'DBPwd') ; OM> Is their anything else I need to consider to connect ? , The server must allow it :) other than that, not really. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Remote DB Connection
Hi people, I have 2 servers , i need to connect to 1 remote mysql server ,i am using the normal : @mysql_connect ('ipaddres-server2', 'DBName', 'DBPwd') ; Is their anything else I need to consider to connect ? , Thank you -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] selecting a constant or label in php
COMM_REGIONID and COMM_TRKGRP are not columns in the tables. They are the actual table names. I want the count of the PHYSICAL_ID where it is NULL. I need to do this for multiple table so I want to hardcode the tablename and then have the count: --- COMM_TKGRP0 COMM_REGIONID 0 using "COMM_REGIONID", 'COMM_REGIONID' and \"COMM_REGIONID\" all fail with: Warning: sybase_query() [http://www.php.net/function.sybase-query]: Sybase: Server message: COMM_REGIONID not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output). It's not found because it's not a column. I just want it in there so when I insert it into another table I will know which count applies to which table. Everything I try, gets an error. Sorry, I should have mentioned what COMM_REGIONID was first. From: "Jon Davis" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP-DB] selecting a constant or label in php Date: Wed, 03 Dec 2003 09:39:33 -0600 Sorry for another newbie question, I'm learning. In Sybase I can do: select "COMM_REGIONID" , count(1) from COMM_REGIONID where PHYSICAL_ID is null select "COMM_TKGRP" , count(1) from COMM_TKGRP where PHYSICAL_ID is null I get parsing errors when putting it in this: $result = sybase_query("select "COMM_REGIONID" , count(1) from COMM_REGIONID where PHYSICAL_ID is null select "COMM_TKGRP" , count(1) from COMM_TKGRP where PHYSICAL_ID is null" , $server_sybase); How can I hardcode "COMM_REGIONID" and "COMM_TRKGRP"? _ Wonder if the latest virus has gotten to your computer? Find out. Run the FREE McAfee online computer scan! http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Get holiday tips for festive fun. http://special.msn.com/network/happyholidays.armx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] selecting a constant or label in php
Sorry for another newbie question, I'm learning. In Sybase I can do: select "COMM_REGIONID" , count(1) from COMM_REGIONID where PHYSICAL_ID is null select "COMM_TKGRP" , count(1) from COMM_TKGRP where PHYSICAL_ID is null I get parsing errors when putting it in this: $result = sybase_query("select "COMM_REGIONID" , count(1) from COMM_REGIONID where PHYSICAL_ID is null select "COMM_TKGRP" , count(1) from COMM_TKGRP where PHYSICAL_ID is null" , $server_sybase); How can I hardcode "COMM_REGIONID" and "COMM_TRKGRP"? _ Wonder if the latest virus has gotten to your computer? Find out. Run the FREE McAfee online computer scan! http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] character problem with mssql
Hi; I use php and mssql. I have got a character problem. I must use turkish chracters. When I select datas from database it works true and I can see turkish characters but when I want to insert new datas to database it set wrong character. For example "Şİ" characetrs look like "?" How can I solve this problem? My data type is char 100. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] I 'am not so goooood with php....
What I'am doing wrong??? I just don't know. All I will like to do is for every Odd record create a new row(TR) with new . If record is Even in record set start second en close en close row(). 0) {echo ""; echo ""; echo $row_rsSubGroup['name']; echo ""; if $tel == $dbrows{ echo ""; } } else { echo ""; echo $row_rsSubGroup['name']; echo ""; echo ""; } $tel +=1; ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Images on-fly
Hallo People, I have one problem with creating images on-fly. Therefore I created 2 files: 1. resize_image.php with the following AND 2. filex.php .In that file i read from database where the image is stored en then i show small images(thumbnails). thet part of the code is : "; ?> This doesn't WORK. Please HELP. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php