Hey folks,
i m learning php as i rolling along i m coming out with question so here r some.
In maths why in addiction its $var += 4, where $var can be any number
what is difference between variable and arrays?
here is my code. i m getting a undefined index at last echo. also where i m printing 2 array. the second array isn’t being printed instead its saying o. why?
because $var += 4 can by typed faster, and is more readable, than $var = $var + 4;
The same way $var++ is the same as $var = $var + 1;
They are just shortcuts because you use increments quite a lot.
An array is also a variable, but it’s a variable that holds other variables.
They are used because you sometimes have a lot of variables and you like to store them in a good compact way, and you can iterate them (take a look at the for “function” (it’s technically speaking not a function, but rather a language construct).
thanks XTX.dumb me to have a typo, though one question left which i asked in 3rd one is that i can’t echo my second array. like its echoing e . here is the code
that will echo the nested array value which is 7.anyhow i got it right, moving along i was studying implode and explode. and i din’t get why they r used?
hey folks, as i m moving towards my php learning joruney i m facing another probelm. i got the idea of concatination but i m unable to follow inplace subsitution (the curly braces replacement for .) here is a query i m following from a tutorial but something is wrong after WHERE. can anyone help me. its giving me error
$result= mysql_query("SELECT * FROM pages WHERE subject_id = {$row["id"]}");
Edit: i posted this Question in MySql forums and i was told its a php question and the guy told me there to replace double quotes inside string with single quote. whch i did but still getting an error
Why don’t you post here corrected code, with single quotes?
Did you really replace it?
And what error message you get? You may be don’t know, but we have not telepathy here yet.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1
The first loops fine. but the 2nd statment where it says where have some problem