Hi all at Daniweb,

I'm quite new to PHP and I'm banging my head over this...

query 1 WORKS:

$query = "CALL procedure_is_a_great_way_to_let_db_do_some_work('1','6')";
//both 1 and 6 are IN parameters!

query 2 DOESN'T WORK:
$id_pictures = 1;
$id_names = 6;
$query = "CALL procedure_is_a_great_way_to_let_db_do_some_work('".$id_pictures."','".$id_names."')";
//both 1 and 6 are IN parameters!

Recommended Answers

Your 2 queries look identical, can you do var_dump($query); after each of them so you can see the computed strings that are being sent.

The only difference I can see is $id_pictures = 1; would be stored as a integer but PHP should add this into the string no problem.

Jump to Post

All 2 Replies

Re: Values from PHP variables to MYSQL procedure 80 80

Your 2 queries look identical, can you do var_dump($query); after each of them so you can see the computed strings that are being sent.

The only difference I can see is $id_pictures = 1; would be stored as a integer but PHP should add this into the string no problem.

Re: Values from PHP variables to MYSQL procedure 80 80

thanks Biiim for your answer.

I don't know what happened... in the mean time I again tried differrent forms of this statements... and when I used the last mentioned sentence it got through. Now it works as it should. I feel 'very olimpic' right now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.