Re: [PHP-DB] CREATE TABLE $phpVariable_for_tableName <--- help please!

2004-03-09 Thread Jason Wong
On Wednesday 10 March 2004 15:11, AJ Seelund wrote:

> 11 //create a table
> 12 $sql = 'CREATE TABLE $newTable ( `daUser` VARCHAR( 255 ) NOT NULL ,'
> 13. ' `entryNumb` INT NOT NULL ,'
> 14. ' `priv` VARCHAR( 1 ) NOT NULL ,'
> 15. ' `comm` BLOB NOT NULL ,'
> 16. ' PRIMARY KEY ( `entryNumb` ) )';
> 17
> 18
> 19 $resulter = mysql_query($sql) or die("There has been an error
> creating table: $newTable");

> on line 12 is where ive narrowed the error to.  i know that the table
> name is what is supposed to be there but im trying to create this based
> on a post entry number and then adding "_comms" to the name..

Right so echo($sql) to find your error.

> so the comments table for post number 1 would be named: 1_comms
> im also having an issue with line 3, creating that name

Use the concatenation operator, which is a period (.), a + is the mathematical 
addition operator.

Also, always use mysql_error().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Every journalist has a novel in him, which is an excellent place for it.
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: CREATE TABLE $phpVariable_for_tableName <--- help please!

2004-03-09 Thread AJ Seelund
ok, i got it now.  i was messing up the concatenation.  thanks vincent

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] CREATE TABLE $phpVariable_for_tableName <--- help please!

2004-03-09 Thread AJ Seelund
i cant get this to work right, im building a comments for my blog. im 
pretty knowledgeable about php code and i am willing to listen, even 
though im still learning.  my code in the php doc is as follows:

1 //select the db
2 $db = mysql_select_db($mydb) or die("db connect error");
3 $newTable = $entryNum + "_comms";
4
5 //if posting a comment do this:
6 if ($comms==true) {
7
8 //define a table name based on main Post number
9
10
11 //create a table
12 $sql = 'CREATE TABLE $newTable ( `daUser` VARCHAR( 255 ) NOT NULL ,'
13. ' `entryNumb` INT NOT NULL ,'
14. ' `priv` VARCHAR( 1 ) NOT NULL ,'
15. ' `comm` BLOB NOT NULL ,'
16. ' PRIMARY KEY ( `entryNumb` ) )';
17		
18
19 $resulter = mysql_query($sql) or die("There has been an error 
creating table: $newTable");
20
21

---end

on line 12 is where ive narrowed the error to.  i know that the table 
name is what is supposed to be there but im trying to create this based 
on a post entry number and then adding "_comms" to the name..

so the comments table for post number 1 would be named: 1_comms
im also having an issue with line 3, creating that name
please help me :)

thanks
-AJ seelund
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] win32 Timestamp problem

2004-03-09 Thread Marcjon Louwersheimer
Not sure if this'll help you, but I like to store my dates/times using
this format: date("Y-m-d H:i:s") It's always a 19 character string, so
you could use the substr function to get different parts of the date.
substr(date("Y-m-d H:i:s"),0,4) would get the year, for example. Hope
this helps.
-- 
  Marcjon

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Encode/Decode Question

2004-03-09 Thread Robin 'Sparky' Kopetzky
Good afternoon.

I am running MySQL version 3.23.55-nt and do not have SSL of any kind
complied. The question I have is this: I am using a combination of several
values to build up a 'key' string. Is the ENCODE/DECODE combination using
this method a good enough encryption to allow the storing of credit card #'s
or would AES emcryption be better?

Thanks for any information to guide me in this issue.

Robin Kopetzky

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] win32 Timestamp problem

2004-03-09 Thread J. Kevin C. Burton
Hey all, after reading documentation on the Win32 bug regarding Timestamps
not being able to go prior than 1970.. 

I am in need of a way to calculate someone's age.


Has anyone found a fix or workaround for this bug? Or a way to calculate age
without using the timestamp?

 

They say that v5 of PHP will fix this issue, but I've been using every
stable release of PHP5 and it's a no go.

 

Any help would be appreciated.

 

 

Regards

 

Kevin



RE: [PHP-DB] output formatting question

2004-03-09 Thread Gary Every
1. Get the result set in an array: $result

Now, do this:

' . $first . ' ' . $last . '
  (' . substr($phone,0,3) . ') ' . substr($phone,3,3) . '-'
. substr($phone,6,4) . '';

}

?>

That will give you in HTML:
John Smith(213) 555-1212


Some other formatting hints for this:

$first = ucfirst(strtolower($first));

will give you "John" even if the DB has "JOHN" or "john" 

Gary Every
Sr. UNIX Administrator
Ingram Entertainment Inc.
2 Ingram Blvd, La Vergne, TN 37089
"Pay It Forward!"

-Original Message-
From: redhat [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 09, 2004 9:24 AM
To: phplist
Subject: [PHP-DB] output formatting question

I have a small database of employee names and phone extensions that I
have put together.  I have also put together a very simple php page that
enables endusers to pull up this directory listing.  My question is
simple, the output right now is in one long column (actually, three,
first name, last name, extension) and I would like to break the page
down into two columns (consisting of the three database columns each). 
I am not a php programmer and would appreciate any help.  If there is a
good article out there that someone could point me to that would be
great - that is how I figured out how to do the other.
thanks,
DF

-- 
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] any good jobsite php scripts?

2004-03-09 Thread Denis L. Menezes
Hello friends.

There are many job site scripts at hotscripts.com, which is becoming
difficult to choose. Can anyone suggest a good one that they have tested?

Thanks
Denis

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] output formatting question

2004-03-09 Thread redhat
I have a small database of employee names and phone extensions that I
have put together.  I have also put together a very simple php page that
enables endusers to pull up this directory listing.  My question is
simple, the output right now is in one long column (actually, three,
first name, last name, extension) and I would like to break the page
down into two columns (consisting of the three database columns each). 
I am not a php programmer and would appreciate any help.  If there is a
good article out there that someone could point me to that would be
great - that is how I figured out how to do the other.
thanks,
DF

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php