[PHP-DB] data formats

2011-02-20 Thread Richard Dunne
I'm submitting form data which is a mixture of checkboxes and text inputs, some of which are integers and a couple text based. I am retrieving the data as follows: $var = (int)!empty($_POST['var']); for checkboxes, $var = (int)$_POST['var']; for integers and $var =

Re: [PHP-DB] Online PHP-Mysql Meeting

2010-03-19 Thread Richard Dunne
If anyone has any ideas for a tutorial, create a list. Others can add to it. Then those interested in creating tutorials can select the idea(s) from the list they are most familiar with. How does that sound? - Original Message - From: Gunawan Wibisono landavi...@gmail.com To:

Re: [PHP-DB] Re: Online PHP-Mysql Meeting

2010-03-18 Thread Richard Dunne
Due to time zone differences, people in various zones (countries/continents) can only avail of a live event within a certain time period. A recorded presentation can be viewed by anyone anytime anywhere. No time zone constraints. Obviously, whoever is taking on the role of tutor in a live event

Re: [PHP-DB] Online PHP-Mysql Meeting

2010-03-18 Thread Richard Dunne
Well if it could be subtitled in any way, that would solve the problem, and again I say IF. Richard. - Original Message - From: David McGlone da...@dmcentral.net To: php-db@lists.php.net Sent: Thursday, March 18, 2010 12:07 PM Subject: Re: [PHP-DB] Online PHP-Mysql Meeting I think

[PHP-DB] resources and resource types

2008-03-31 Thread Richard Dunne
When I did a search on resource(5) within the PHP online documentation, I found the resource page resource.php. While although it lists all the resources used with mysql, it does not mention how resources are related to resource numbers as above. A query such as a row count on a table results

[PHP-DB] mysql_num_rows, resource id #

2008-03-27 Thread Richard Dunne
In my code below, I am trying to verify that the query is selecting data from both rows of my answers table. I have run the query on my MySQL CLI and getting answers from both rows, but running this script I get $rows = 0. I can't figure out why its not returning 2 for the number of rows. It

Fwd: Re: [PHP-DB] mysql_num_rows, resource id #

2008-03-27 Thread Richard Dunne
as $a) { echo $a; } ? The output is 1 1 which is correct. One small step at a time, hopefully forward. Richard. ---BeginMessage--- Richard Dunne wrote: In my code below, I am trying to verify that the query is selecting data from both rows of my answers table. I have run

[PHP-DB] Resource id #5

2008-03-27 Thread Richard Dunne
Can someone explain how I can translate Resource id #5 which is what I am getting from the code below? $result = mysql_query(Select answer from answers) or die(mysql_error()); $resultArray = explode(',',$result); for ($i=0;$isizeof($resultArray);$i++) { echo $resultArray[$i]; } --

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
- Original Message - From: Chris [EMAIL PROTECTED] Date: Wednesday, March 26, 2008 2:18 am Subject: Re: [PHP-DB] numeric string to single digit array Richard Dunne wrote: Sorry for the top-posting, it's my mail client, not my design. I honestly have not even looked at myphpadmin

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
- Original Message - From: Evert Lammerts [EMAIL PROTECTED] Date: Wednesday, March 26, 2008 3:12 pm Subject: Re: [PHP-DB] numeric string to single digit array I ran this $query =Select answer from answers where studentID ='A123456789'; $result =

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
- Original Message - From: Evert Lammerts [EMAIL PROTECTED] Date: Wednesday, March 26, 2008 3:39 pm Subject: Re: [PHP-DB] numeric string to single digit array PHP is telling me that the resource I am using for mysql_fetch_assoc is invalid: $query =Select answer from answers

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
- Original Message - From: Evert Lammerts [EMAIL PROTECTED] Date: Wednesday, March 26, 2008 4:04 pm Subject: Re: [PHP-DB] numeric string to single digit array This is my code. The only error is at line 15 as I stated above. 1 ?PHP 2 DEFINE (host,localhost); 3 DEFINE

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
- Original Message - From: Evert Lammerts [EMAIL PROTECTED] Date: Wednesday, March 26, 2008 4:30 pm Subject: Re: [PHP-DB] numeric string to single digit array OK. Tried that and count comes back as 1. So your query returns only one record. Try $query =Select answer

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
- Original Message - From: Evert Lammerts [EMAIL PROTECTED] Date: Wednesday, March 26, 2008 5:22 pm Subject: Re: [PHP-DB] numeric string to single digit array Tried that as well and got the same result. I tried Select count(answer) as total from answers where

Fwd: Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
Using this extract from http://ie.php.net/manual/en/control-structures.foreach.php Amaroq 09-Mar-2008 06:40 Even if an array has only one value, it is still an array and foreach will run it. ?php $arr[] = I'm an array.; if(is_array($arr)) { foreach($arr as $val) { echo $val;

Fwd: Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Richard Dunne
I did var_dump on the result resource and I got resource(5) of type (mysql result). ---BeginMessage--- On Mar 26, 2008, at 12:30 PM, Evert Lammerts wrote: OK. Tried that and count comes back as 1. So your query returns only one record. Try $query =Select answer from answers; Why not

[PHP-DB] numeric string to single digit array

2008-03-25 Thread Richard Dunne
Can anyone tell me how how to convert a string of integers into an array of single digit integers. i.e. 1223123 into ['1','2,','2','3','1,'2','3'] ? When I retreive a column of single digit integers I end up with a long string of numbers. I think PHP is seeing this as one whole number and

Re: [PHP-DB] numeric string to single digit array

2008-03-25 Thread Richard Dunne
array Please always CC the mailing list so others can learn and also contribute answers. Also please don't top-post as it makes it hard to follow discussions. Richard Dunne wrote: I am using MySQL and retrieving a single column which consists of single digit integers. I have been doing