php function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mihai
Forum Newbie
Posts: 6
Joined: Mon Feb 11, 2008 6:28 pm

php function

Post by mihai »

hi.
I have 2 php scripts that use the same DB,
and i want to mash this scripts togheder but i have problems because both of this scripts are registering users. One with the functions name $id and $pass , and the second one function test_users $id ( username ).
My questions is how to use the same id for both, were first $id= test_users - $id ?
Do i have to modifie in SQL ?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php function

Post by John Cartwright »

Your explanation was a bit confusing.. can you post some code?
mihai
Forum Newbie
Posts: 6
Joined: Mon Feb 11, 2008 6:28 pm

Re: php function

Post by mihai »

SELECT COUNT( * ) AS `Rows` , `id`
FROM `test_users`
GROUP BY `id`
ORDER BY `id`
LIMIT 0 , 30

first script uses this SQL

and the second
member_id mediumint(8) UNSIGNED ZEROFILL No auto_increment
login varchar(20) latin1_swedish_ci No
enabled enum('yes', 'no') latin1_swedish_ci No yes
password varchar(20) latin1_swedish_ci No
email varchar(150) latin1_swedish_ci No
displayname varchar(25) latin1_swedish_ci No
newsletter enum('yes', 'no') latin1_swedish_ci No yes
ipaddr varchar(16) latin1_swedish_ci No
mihai
Forum Newbie
Posts: 6
Joined: Mon Feb 11, 2008 6:28 pm

Re: php function

Post by mihai »

in my database i have test_users that is been used by a script that registers users and a second one member_id that is been used by a diferent script.
Hope this helps. If not please tell me what info you need.
Mihai
mihai
Forum Newbie
Posts: 6
Joined: Mon Feb 11, 2008 6:28 pm

Re: php function

Post by mihai »

if you need some info i have right now phpmyadmin open and i can copy anything you need.
Thank you.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php function

Post by John Cartwright »

Why don't you just rewrite the script? Doesn't seem very practical trying to mash two pieces of code together.

I still am very confused as to what you are talking about?
in my database i have test_users that is been used by a script that registers users and a second one member_id that is been used by a diferent script.
Hope this helps. If not please tell me what info you need.
Mihai
Just want to clarify some things..

You have a table test_users?
And you have two different scripts inserting into this table?

Also, please use the edit button instead of multiple posts in a row.
mihai
Forum Newbie
Posts: 6
Joined: Mon Feb 11, 2008 6:28 pm

Re: php function

Post by mihai »

i have a DB medieval were one table created from a php script made "members_id", and i installed a new script on the same database that created a new table "test_id", and i want to instert some functions from one script in to other, but i does not work because both of the scripts require to log in order to use thouse funtions. So my questions is how can i do this.
Or if you want i can point were on my website.
http://www.cetatea.info/
And the second script is on http://www.cetatea.info/index2.php
hope this helps
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Re: php function

Post by Stryks »

So .... are you asking how to open two databases at the same time to copy records from one to the other?

EDIT: Or maybe, how to allow logins from either table?
mihai
Forum Newbie
Posts: 6
Joined: Mon Feb 11, 2008 6:28 pm

Re: php function

Post by mihai »

in order for me to use both scripts i will have to put my users to sign twice in two diferent Id pass box-forms.
So if i want to use one script without them ( my users ) to log twice i just have to ask one function to copy the other value, or do i have to point one value as equal as the other?
Post Reply