473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Extract integer from mysql via PHP

41
mysql and mysqli functions always return strings values, and I understand that I can set the type of the data via the settype function AFTER I extract the data, but is there a way with PHP to extract the data as it is specified in the mysql database? (i.e if the type is an integer then PHP will insert the integer value in the result set).

The reason I ask is I want to create a function to verify the integrity of the database before I process it and if I can skip creating a function using regex to check if the value is an integer I would go that route.

Any help is appreciated
Dec 13 '07 #1
2 1675
aktar
105 100+
Instead of extracting the data from the db and checking it, why dont you check the database itself?


try this : SHOW FULL COLUMNS FROM [YOUR TABLE]


more info:
http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
Dec 15 '07 #2
clai83
41
Instead of extracting the data from the db and checking it, why dont you check the database itself?


try this : SHOW FULL COLUMNS FROM [YOUR TABLE]


more info:
http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
Good idea, Thanks man.

Now this question has turned into a MYSQL question.

Is it possible to do some simple data integrity checks using queries? For example checking to see if a particular column has only alphanumeric characters in its data, or something like that.
Dec 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Don Crossman | last post by:
Assume a MYSQL table, foo. One column, bar datetime. Two rows: 2004-01-01 08:00:00 2004-02-01 08:00:00 select * from foo where extract(day from bar)=1; 2 rows in set...
0
by: Ashok | last post by:
Hi, is it possible to extract data from a web based java applet in order to enter that data in mysql? for example, something that would let me extract the data shown in applet on...
2
by: Darren Ferguson | last post by:
Hey all I am trying to extract the epoch from a timestamp variable in plpgsql. The function is as follows: create or replace function test() returns integer as ' declare _test timestamp with...
6
by: Mohammad-Reza | last post by:
Hi I want to extract icon of an exe file and want to know how. I look at the MSDN and find out that I can use ExtractIconEx() Windows API but in there are some changes to that api in c# I made...
3
by: Adam Faulkner via DotNetMonster.com | last post by:
I want to create a method within a class that opens a Microsoft Word 2000 Document and has the facility to Create a new word document and then extract a Page that exists within the original Word...
2
by: beary | last post by:
I have a page with a form which has automatically generated fields, (which come from mysql column names). There could be any number of these fields, and I have no way of knowing exactly what they're...
1
by: bibie | last post by:
How to extract data from mssql and then convert it to mysql using VB6.0. How to connect the mssql..I know a little bit of VB6.0 but only create an interface using STANDARD EXE. Someone told me to...
7
by: laredotornado | last post by:
Hi, I'm using PHP 5 with MySql 5. I have a MySQL InnoDB table with a column of type INTEGER UNSIGNED. Is there a constant in PHP to insert the maximum value possible into the column? The...
1
by: sivadhanekula | last post by:
Hi everyone, I have a problem with my Mysql data. I have 2,95,67,456 lines of data which is too much and if I run this in MYSQL front-end it is telling "OUT OF MEMORY". Any way with my collegues...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.