CalmSoul
asked on
php assistance needed
I have 3 tables
TABLE 1 COLUMNS:
TABLE 2 COLUMNS:
TABLE 3 COLUMNS:
- I am looking for php script which will get data from table 1
- if TABLE 1 content column value doesn't exist in qa_postmetas
THEN
- INSERT (recursively)
- GET inserted postid from qa_posts and insert values from table1 in table 3
qa_postmetas (postid <-- (this is what we have just inserted in first insert),
title, <-- this is hard coded value 'qa_q_extra'
content <-- this is coming from table 1 (URL column)
) )
TABLE 1 COLUMNS:
`test1`(`id`, `title`, `URL`, `img`, `tagsv`
TABLE 2 COLUMNS:
qa_posts (type, categoryid, userid, created, title, content, tags)
TABLE 3 COLUMNS:
qa_postmetas (postid, title, content)
- I am looking for php script which will get data from table 1
- if TABLE 1 content column value doesn't exist in qa_postmetas
THEN
- INSERT (recursively)
INSERT INTO qa_posts (type, categoryid, userid, created, title, content, tags)
(SELECT 'Q_QUEUED', '1', '3', NOW(), f.title, f.img, f.tagsv
FROM dev.test1 f)
and then- GET inserted postid from qa_posts and insert values from table1 in table 3
qa_postmetas (postid <-- (this is what we have just inserted in first insert),
title, <-- this is hard coded value 'qa_q_extra'
content <-- this is coming from table 1 (URL column)
) )
ASKER
I am using MYSQL
thanks
thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
its one time ...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please give us more information