Warning: Cannot modify header information - headers already sent by (output started at C:\apachefriends\xampp\htdocs\view_product.php:119) in C:\apachefriends\xampp\htdocs\view_product.php on line 127
???JFIF``??Caaaa $.’ ",#(7),01444’9=82<.342??C 2!!22222222222222222222222222222222222222222222222222????"??a …and so on!!!
i tried using the
" header('Content-type: ’ . $type); " at the top before html, and still it gives out the same but without the warning.
thanks alot Hammerhead;
you saved my life only with one statement
‘There shouldn’t be any HTML in this particular PHP script’
i kept every thing correct but still problem was there; so after removing those htmls from my php file the thing got worked; it took me three days down the road without answers.
thanks alot
Why not just use an autonumber field type and let MySQL do this for you? I’m guessing you’re trying to use this field as a unique ID or counter, right. Right? If so, in general it’s best to rely on the DB or use some sort of stored procedure. Doing it in PHP as you’re trying will fail in a multi-user update situation.
User A starts your script and retrieves the old ID - let’s say 100
User B does the same and also gets 100
User A’s script finishes and stores 101 in the field
User B’s script also finishes and stores 101 in the field.
Unless you apply some sort of locking & blocking, your data is going to get messed up like this.
As for your code, it should be something like:
$sql=“select max(p_id) AS theMax from product”;
$result =mysql_query($sql) or die (mysql_error());
hi Hammerhead Shark
thanks a lot lotttttttttttt
i have also problem that can’t display picture from mysql to html page by php i was got error that modify header error.. i try to solve this problem but no-one can solve this problem.. but by using your idea i have solved problem so thank a lot