i use php 4.12 + mysql 3.23.49 on linux .
i've developed a online testing(quiz) -aplication that now is expected to
behave somehow different from what i've had in mind at the begining . More
i have 3 tables (MyIsam):
1. tests (id,name,desc)
2. questions (id,id_test_fk,desc)
3. answer(id,id_q_fk,desc,points) .
i want to copy a question from one test to another .
If i knew that from the start , i would have designed the tables differntly
, but that's another problem .
the point is i'm trying to do a 'quick_and_dirty' patch like this :
create temporary table q_temp as select * from questions;
create temporary table ans_temp as select * from answers;
insert into questions select
from q_temp as t2 where id=@q_id;
insert into answers select '',@last,score,description from ans_temp where
where $test_target and $qid are given from php .
my problem is that this query works and dows what is expected when run from
but NOT from php . No error , nada . I even tryed to do dirty thing
(shell_exec('mysql -u user -p password database </tmp/qry.txt')) where
qry.txt was generated
by php (containing the above code) but NO luck .
could you please give a suggestion or ..smth ?