473,788 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP: Simple question

In C and other languages I have had the need to convert from a character to
an integer. This is easy. Now, however, this is the first time I have had
to do this in PHP and I can't find the proper function. The reason I need
this is that upon downgrading to MySQL 4.0.7 (upon changing servers), data
that are in the tables contain characters that are not translated properly.
These characters are (at least two of them are) â and ?. I want to decode
part of the string to its integer representation to see how I can handle
this problem. Interestingly, the character T translates properly. The
actual sequence (or one of them) is â?T

I would love to avoid the necessity of fixing all those strings in the
database.

--
Shelly

PS: I included the PHP prefix label for the filtering challenged :-)
Nov 13 '07 #1
2 1164
On 13 Nov, 15:15, "Shelly" <sheldonlg.n... @asap-consult.comwrot e:
In C and other languages I have had the need to convert from a character to
an integer.
try ord()

C.

Nov 13 '07 #2
C. (http://symcbean.blogspot.com/) wrote:
On 13 Nov, 15:15, "Shelly" <sheldonlg.n... @asap-consult.comwrot e:
>In C and other languages I have had the need to convert from a
character to an integer.

try ord()

C.
Thanks, that worked. I knew it had to be simple.

--
Shelly
Nov 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
2686
by: Bob | last post by:
When I first started in web programming (I left it for more than a few years) I programmed my web pages in C and a little perl. Now that I have a need to come back to web programming I find that php is all the rage. But looking a php syntax I can't help but notice it is very C like, which is no surprise. But I wonder, other than the lack of pointers in php (not a bad thing I admit!) and the ease in which php does variables, litte to...
27
4759
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it appears that the data goes straight to the processing page, rather than the javascript seeing if data is missing and popping up an alert. I thought it may be because much of the form is populated with data from the db (lists, etc.), but when I leave...
1
1580
by: macklin01 | last post by:
Hi, everybody. I'm trying to do some last cleaning up on the following php page I wrote: http://www.math.uci.edu/~pmacklin/Publications.php This URL parses an XML file of publications: http://www.math.uci.edu/~pmacklin/Publications.xml
27
5153
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set contents ]; close $fileID
15
10513
by: himilecyclist | last post by:
My State government organization has written a PHP/MySQL application which has been in production for about 6 months and has been highly successful. We are now embarking on a similar database application, but one with much higher security concerns (birth data). Prior to beginning the project, we met with an oversight committee who strongly advised against PHP and suggested Java. Their concern was that PHP could not be trusted to...
9
3599
by: Ben | last post by:
Hello, I'll bet this has been asked a million times but I can't seem to find a thread that gives the clear example I need. This PC has MySQL and IIS configured and running. The MySQL database is "myDB" with a table "myUsers" with fields "Username" and "Password". I also have the MySQL ODBC driver loaded with a DSN "dsnMySQL" setup. First question is can someone direct me to a site or provide a sample code for a login page that...
6
1675
by: Ronald Raygun | last post by:
I want to be able to randomly select the following from an array: 1). An image 2). A piece of text (name of tge image) 3). A piece of text (description of the image) I want to be able to build a static array with the values hardcoded into the array, and then be able to randomly select an item from the array and retrieve the image, name and description.
5
1734
by: SM | last post by:
Hello I have simple question using simpleXML and PHP. i have an xml file that looks like this: <?xml version="1.0" encoding="UTF-8"?> <discography version="0.01"> <CD> <title>Moonlight</title> <year>1978</year>
4
1583
by: maheshgupta0248 | last post by:
Hi all, Im a newbie in php, started learning php on my own. I want to create small website using php, that contains links for two simple webpages > C questions > C++ questions C questions page, contains a sequence of questions. Each question is a link to another page which details the answers of the specific question, any user can be able to enter his comments to the question. so the new comment should be queued to the existing...
3
1957
by: deepaks85 | last post by:
Hi Friends, I have a simple HTML form and simple PHP code which sends the filled information at my email address. Now, I am trying to get Page URL and Page Title at my email while submitting a form alongwith the info filled by user. Here is my HTML form: <form action="emailus.php" method="POST" name="Email_Submit" class="divtext"> <table width="400" border="0" cellspacing="0"...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.