Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Users\Mario\Desktop\General Websites\Template 2\xampplite\xampplite\htdocs\Portfolio2\Administrator\gallery\uploadimg.php on line 42 Problem uploading image.
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Users\Mario\Desktop\General Websites\Template 2\xampplite\xampplite\htdocs\Portfolio2\Administrator\gallery\uploadimg.php on line 42
can u pls help me to display my products in different pages categorized by bags, dresses,sandal and accessories...using table databases using php??? this is my projct...huhuhu...pls help me... ds s my email anne_bonch16@yahoo.com
Wtf, once I write "type="file" the button automatically displays "Choose file - no file chosen". How do I change this if I want it to display in a different language or give a different message?
man its nor working. when I write the part checking if you sent something it never shows the content of the image. it just shows me "no file chosen " and the script "error_reporting(E_ALL ^ E_NOTICE);" is not solving the problem, its just ignoring it. when i open the site in my browser it does not fix it!!!
the upload is not working. I've followed all the codes and its orientation.. but the upload seemed erroneous. It says problem with the upload. The query for the INSERT INTO tablename is not working properly and everytime I check the database, no data was uploaded.
sir.. can you make a tutorial.. that a user can input a name, description, as an input, and then together with the form is an upload image.. that stores in ex."imagefolder" just like what you have shown in this tutorial, and stores all into the database.. this one is my thesis sir..hope u could help me..
so strange, when i put the 'please select an image' statement in like you did at 12:12 it doesn't show, before or after the upload. and when i put echo in front of $file like you did at 11:15 but it seems to show a random string like /var/tmp/phpAkA7U8 even before i upload anything.
make sure you change all the appropriate Database table information to your table for your image files also change the config information - example: "Your_host" to your database host, username, password and database information so it works for your database:
name the file: image_results.php or something you want
place it in the image directory you create that all the images stored in.
@mikemerr Mike where can I email you Because I used : $image = base64_decode($image);
$image = imagecreatefromstring($image);
header("Content-Type: image/png");
imagepng($image);
imagedestroy($image);
Whitout results, could anybody help, because no clue what is wrong Also when I check the source code I get I'm pretty new on php. Alex any suggestion to display the image?
This is not an error. It is "only" a Notice. It works also with this notice. You can disable it by putting error_reporting(0); at the top of the php script file.
Before $file get a value from $_FILES, $_FILES need isset into the page. When you open the site, $file will the value of $_FILES, but it isnt exists, when you open the site, and the image is not chosen. I think it is better, to check the $_FILES before $file will take the value of $_FILES. The checkcode "if(isset($_FILES['images'] ['tmp_name']))". This can fix an Undifined index-error.
For those people getting the "Notice: Undefined index: image in C:\wampw w w\Folder\index.php on line 19, where $file = $_FILES['image'] ['tmp_name']" Error,
I founf that this seems to work: if (isset($_FILES['image'])) { $file = $_FILES['image']['tmp_name']; }
This is not an error. It is "only" a Notice. It works also with this notice. You can disable it by putting error_reporting(0); at the top of the php script file.
Notice: Undefined index: image in C:\xampp\htdocs\xampp\php\upload_img\index.php on line 22
This is not something that will cause any problems. Alex from phpacademy would get the same error but he has disabled this type of error and therefor it's not showing.
THE SOLUTION:
At the top of the PHP-code, under <?php, add the following code:
Notice: Undefined index: image in C:\wampw w w\Folder\index.php on line 19, where $file = $_FILES['image'] ['tmp_name']; at 10:50 on video as an error but when i echo it seems to show the tmp location,
is this type of storing is same fast as storing in specified folder.. like when you use it in slide show images it has same speed with storing in folder?
I am having some problems to make it work. Is there any chance to send me the source code please? Please I would appreciate it very much if you could send the source code for this tutorial. Many thanks. my email is: marcelocbacchi@hotmail.com
everything is working fine......but m unable to view image....a small box with a question mark is appearing... i checked...the file contents are there...but it is not displaying the image....what am i doing wrong? please help
@kdodz Well, you can either make the user crop the image after upload, or you can automatically resize it. Or, you could just only allow a certain dimension of image.
After the "your image" title I get the blue box with the question mark in it. For some reason it's not displaying the image... why is that? Someone please help. Thanks in advanced!
@SmithyProductions When I submit it in the echo on the "file_get_contents" I get a whole bunch of "�PNG IHDRli߫�~ pHYs.#.#x�?v OiCCPPhotoshop ICC profilexڝSgTS�=�..." Why are there "�"'s there? Thanks
When I submit it in the echo on the "file_get_contents" I get a whole bunch of "�PNG IHDRli߫�~ pHYs.#.#x�?v OiCCPPhotoshop ICC profilexڝSgTS�=�..." Why are there "�"'s there? Thanks
Your not "calling" to the right area in your database. You should have 2 .php files in your "htdocs" directory. Hopefully you have made a new folder. Then, in your get.php file, when you select * your database with the SQL command, make sure that the table you are calling to in the index.php has the field that $file=$_files['whatever field'] in it.
Getting an error on line where we define the file which is $file=$_FILES['image']['tmp_name']; Im using php ver 5.3.0 and mysql 5.1.36. my error definition is Undefined Index Image: any thoughts??? please help me out... thnx in advance
Thank you. You have such a calming attitude and explain things so well. This is my first time subscribing to a channel on YouTube. You have a new student. :)
can you help me with this error after doing all you've done from part one to part two?..
"Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\acme_corp1\discussion_file\building_a_cms\hrefselected\index.php on line 39"
korniskateboarding 2 days ago
and this error:
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Users\Mario\Desktop\General Websites\Template 2\xampplite\xampplite\htdocs\Portfolio2\Administrator\gallery\uploadimg.php on line 42 Problem uploading image.
marifard 2 days ago
I made this tut but it show this error:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Users\Mario\Desktop\General Websites\Template 2\xampplite\xampplite\htdocs\Portfolio2\Administrator\gallery\uploadimg.php on line 42
marifard 2 days ago
can u pls help me to display my products in different pages categorized by bags, dresses,sandal and accessories...using table databases using php??? this is my projct...huhuhu...pls help me... ds s my email anne_bonch16@yahoo.com
elementmirrage 1 week ago
image won't display
aerakiller56 2 weeks ago
not gayly but i love alex .....aaaaaaaaaalex
alimunth 1 month ago
Wtf, once I write "type="file" the button automatically displays "Choose file - no file chosen". How do I change this if I want it to display in a different language or give a different message?
PktMma 1 month ago
@PktMma yeah im looking for that too =/
frankytap 3 weeks ago
man its nor working. when I write the part checking if you sent something it never shows the content of the image. it just shows me "no file chosen " and the script "error_reporting(E_ALL ^ E_NOTICE);" is not solving the problem, its just ignoring it. when i open the site in my browser it does not fix it!!!
andreasellerbrock 1 month ago
the upload is not working. I've followed all the codes and its orientation.. but the upload seemed erroneous. It says problem with the upload. The query for the INSERT INTO tablename is not working properly and everytime I check the database, no data was uploaded.
mOnsi9115 2 months ago
sir.. can you make a tutorial.. that a user can input a name, description, as an input, and then together with the form is an upload image.. that stores in ex."imagefolder" just like what you have shown in this tutorial, and stores all into the database.. this one is my thesis sir..hope u could help me..
bronsebautista 2 months ago
so strange, when i put the 'please select an image' statement in like you did at 12:12 it doesn't show, before or after the upload. and when i put echo in front of $file like you did at 11:15 but it seems to show a random string like /var/tmp/phpAkA7U8 even before i upload anything.
paperboy438 2 months ago
Comment removed
paperboy438 2 months ago
Hi do you have a tutorial for displaying the images?
kenwin916 2 months ago
very nice and understanding
keep posting more...
Ilijana95 3 months ago
This has been flagged as spam show
error_reporting(E_ALL ^ E_NOTICE); is use to bypass the error, but how to fix the error in a right way?..and not just error bypassing?..
paulmariz 3 months ago
Comment removed
paulmariz 3 months ago
sorry guys hold on the code was too long to post on youtube I will find a way to get it to you soon.
mikemerr 3 months ago
hey guys here is the full code that i used:
make sure you change all the appropriate Database table information to your table for your image files also change the config information - example: "Your_host" to your database host, username, password and database information so it works for your database:
name the file: image_results.php or something you want
place it in the image directory you create that all the images stored in.
also don't forget to wrap all this in php tags
mikemerr 3 months ago
for all who can not see images use codes:
$db_img = base64_decode($db_img); echo ($db_img );
$db_img = imagecreatefromstring($db_img);
you have to base64_encode it first then base64_decode it...then use the imagecreatefromstring() function.
if you want the code email me....
mikemerr 4 months ago
@mikemerr
put this code where?
torreerrot 3 months ago
This has been flagged as spam show
email my youtube inbox
mikemerr 3 months ago
@mikemerr Hi Mike Where can I email you? I need help displaying the image thanks
cadysistemas 3 months ago
@cadysistemas
message me in my yourtube inbox and i will get you what you need.
mikemerr 3 months ago
@mikemerr Mike where can I email you Because I used : $image = base64_decode($image);
$image = imagecreatefromstring($image);
header("Content-Type: image/png");
imagepng($image);
imagedestroy($image);
Whitout results, could anybody help, because no clue what is wrong Also when I check the source code I get I'm pretty new on php. Alex any suggestion to display the image?
cadysistemas 3 months ago
@ahmedebeid Hello.
This is not an error. It is "only" a Notice. It works also with this notice. You can disable it by putting error_reporting(0); at the top of the php script file.
Regards,
Mogress
Mogress 5 months ago 2
@Mogress This will stop all sorts of errors from showing wich could be a problem. This is more specific and therefor better:
error_reporting(E_ALL ^ E_NOTICE);
androidfredrik91 5 months ago
Thanks for the great php and mysql tutorials.. I really enjoy them.. I'm learning very useful things from them.
cyberswim 6 months ago in playlist PHP Tutorials
EXTRA!
lazanebo 6 months ago
Before $file get a value from $_FILES, $_FILES need isset into the page. When you open the site, $file will the value of $_FILES, but it isnt exists, when you open the site, and the image is not chosen. I think it is better, to check the $_FILES before $file will take the value of $_FILES. The checkcode "if(isset($_FILES['images'] ['tmp_name']))". This can fix an Undifined index-error.
Ninoschrijver 6 months ago
Nice tutorial it is very use full
nmarediya 7 months ago
are you using wamp
095jamie 7 months ago
@095jamie he is using xampp
ShallowHeartNB 6 months ago
lol the undefined index's are normal - hide them with "error_reporting(0); "
Acceptable76 7 months ago
This has been flagged as spam show
For those people getting the "Notice: Undefined index: image in C:\wampw w w\Folder\index.php on line 19, where $file = $_FILES['image'] ['tmp_name']" Error,
I founf that this seems to work: if (isset($_FILES['image'])) { $file = $_FILES['image']['tmp_name']; }
hope this helps :)
kil1crazy 8 months ago
Alex thanks so much for the tutorials. How about for several images?
mkcircles 8 months ago
how can you do this for more than 1 image? An to keep all images in the same row of the database.
exercitius 9 months ago
No matter what I do all the error messages display, even though the image is successfully uploaded to the database table.
The problem seemsto come from incorrectly placed function brackets; I've tried all I could but am at a loss. It works, but it's ugly.
Anyone knows where to find the file so that I can compare it with what I have?
Cheers!!!
Speendrift 9 months ago
please help erro at:
Notice: Undefined index: image in C:\xampp\htdocs\xampp\php\upload picture to data base\index.php on line 22
please select an image.
i finished the program its working now... but i get this error..
killerboduk999 9 months ago 7
@killerboduk999 I have the same problem. have you got the answer?
am84pm 7 months ago
@am84pm not yet :(
killerboduk999 7 months ago
@killerboduk999 I don't why he is not responding...... I must go and get another tutorial...
am84pm 7 months ago
@am84pm hahaha theres a new video image uploading site...
i think your problem was the php version try to google if(isset($_POST[''submit]))
{
code here/////////////
}
killerboduk999 7 months ago
@killerboduk999 I try to change it. I'm using php5 .thanks for the advice mate.
am84pm 7 months ago
@am84pm hey if you see an php chat tutorial just pm plssss...i need a private chat ill add to my site...
killerboduk999 7 months ago
@killerboduk999 its normal getting that error if that variable doesn't have any value you can turn in off by typping: error_reporting(0);
MrElectrototo 7 months ago
This has been flagged as spam show
@killerboduk999 Hello.
This is not an error. It is "only" a Notice. It works also with this notice. You can disable it by putting error_reporting(0); at the top of the php script file.
Regards,
Mogress
Mogress 5 months ago
***TO ALL WHO GET ERROR***
Notice: Undefined index: image in C:\xampp\htdocs\xampp\php\upload_img\index.php on line 22
This is not something that will cause any problems. Alex from phpacademy would get the same error but he has disabled this type of error and therefor it's not showing.
THE SOLUTION:
At the top of the PHP-code, under <?php, add the following code:
error_reporting(E_ALL ^ E_NOTICE);
That will stop this error from showing.
LIKE THIS SO THAT MORE PEOPLE CAN SEE IT!
androidfredrik91 5 months ago 28
how can i convert to multiple uploader. please help thnks
JDsiteworks 9 months ago
This has been flagged as spam show
hi Alex,
this is very helpful, but i am getting an error
Notice: Undefined index: image in C:\wampw w w\Folder\index.php on line 19, where $file = $_FILES['image'] ['tmp_name']; at 10:50 on video as an error but when i echo it seems to show the tmp location,
any ideas?
Thanks alot
santed 10 months ago
@ahmedebeid @phpacademy yes please im having the same problem. i think there is no answer for this...
santed 10 months ago
i need this but in jsp :(
nightmrmms 11 months ago
make a video showing how to setup phpmyadmin
1EverythingFunny1 11 months ago
@1EverythingFunny1 why would he do that? so easy theres only like 3 vids on it. Search!!!!!!
Sikeman214 11 months ago
@1EverythingFunny1 you should not be here if you dont know that
HawxTeamDelta 10 months ago
i get the same error.
Undefined index: image in C:\wampw w w\Folder\index.php on line 19, where $file = $_FILES['image'] ['tmp_name']; at 10:50
mrjonesgl 11 months ago
@mrjonesgl Same problem for me
am84pm 7 months ago
thanks to you! helped a lot!
dreamer2580 11 months ago
this is VERY helpful! thanks so much!
JchaseMusicTv 1 year ago
all the videos here about uploading this is the most helpful! many thnx PHP Academy!
subscribed!
keizerXP 1 year ago
This video is one of the best tutorial videos i have ever seen online...Thanks a million
OvimTablet 1 year ago
your tutorials makes we want to learn more ^^
Silverz 1 year ago 2
Great tutorial!!
thx thx!
siktpe 1 year ago
can't view the image,how do i fix this?
irenetigas01 1 year ago
I am not a PHP developer, yet this video is very informative!!
dodo309 1 year ago
Can you do a video (or explain) how to have the photo upload function within a form? Also, can you use Dreamweaver CS5?
ewise1984 1 year ago
is this type of storing is same fast as storing in specified folder.. like when you use it in slide show images it has same speed with storing in folder?
HawxTeamDelta 1 year ago
SIR....YOU ARE A LIFESAVER...
Thank you so MUCH
aronjaymez 1 year ago 2
Can you use the BLOB for different stuff other than images?
DrWestofReanimation 1 year ago
How would you restrict the size of the images that were being uploaded?
dashby1969 1 year ago
i can't view the image i iploaded and iserted to the database?
21dhon09 1 year ago
This has been flagged as spam show
I am having some problems to make it work. Is there any chance to send me the source code please? Please I would appreciate it very much if you could send the source code for this tutorial. Many thanks. my email is: marcelocbacchi@hotmail.com
marcelocbacchi 1 year ago
everything is working fine......but m unable to view image....a small box with a question mark is appearing... i checked...the file contents are there...but it is not displaying the image....what am i doing wrong? please help
sidjustice007 1 year ago
@sidjustice007 I am having the same problem. Have you sorted it? Thanks
marcelocbacchi 1 year ago
If you did want to display all of the images that are in the database, you would do a while loop. Just in case anyone wanted to know.
Greenadee 1 year ago
can you help me pls!!!hOW to RESIZE THE IMAGE...i want the size just like FACEbOOK profile pic..pls help me sir.,..
kdodz 1 year ago
@kdodz Well, you can either make the user crop the image after upload, or you can automatically resize it. Or, you could just only allow a certain dimension of image.
It's up to you how you do it, but may I ask why?
Greenadee 1 year ago
Never, never, never upload files in database!!!
nasisof 1 year ago
@nasisof why never never can you tell us why?
75Mrdanny 1 year ago
test #TEST
xxToonlego90xx 1 year ago
yeah nice..
keep posting more...
walterssm 1 year ago
u sir are epic...
scrawfosean 1 year ago
After the "your image" title I get the blue box with the question mark in it. For some reason it's not displaying the image... why is that? Someone please help. Thanks in advanced!
SmithyProductions 1 year ago
@SmithyProductions When I submit it in the echo on the "file_get_contents" I get a whole bunch of "�PNG IHDRli߫�~ pHYs.#.#x�?v OiCCPPhotoshop ICC profilexڝSgTS�=�..." Why are there "�"'s there? Thanks
SmithyProductions 1 year ago
When I submit it in the echo on the "file_get_contents" I get a whole bunch of "�PNG IHDRli߫�~ pHYs.#.#x�?v OiCCPPhotoshop ICC profilexڝSgTS�=�..." Why are there "�"'s there? Thanks
SmithyProductions 1 year ago
@SmithyProductions Wtf.
OnlyInNaziGermany 1 year ago
@KavzXox
Your not "calling" to the right area in your database. You should have 2 .php files in your "htdocs" directory. Hopefully you have made a new folder. Then, in your get.php file, when you select * your database with the SQL command, make sure that the table you are calling to in the index.php has the field that $file=$_files['whatever field'] in it.
Konohaninjaclan 1 year ago
Getting an error on line where we define the file which is $file=$_FILES['image']['tmp_name']; Im using php ver 5.3.0 and mysql 5.1.36. my error definition is Undefined Index Image: any thoughts??? please help me out... thnx in advance
KavzXox 1 year ago
Comment removed
altu892 1 year ago
genius! is this guy a human or martian? must be german or something
ncbookz 1 year ago
@ncbookz hes mexican lulllulul
scrawfosean 1 year ago
@scrawfosean impossible! no mexican is this smart! i have had many mexican friends and they can not even speak english properly
ncbookz 1 year ago
@ncbookz WTF?!?!!?
shapeshifter987 1 year ago
@shapeshifter987 just joking
ncbookz 1 year ago
@ncbookz LOL hoped so haha. cheers!
BTW, great tut!
shapeshifter987 1 year ago
Thank you. You have such a calming attitude and explain things so well. This is my first time subscribing to a channel on YouTube. You have a new student. :)
Thanks.
Konohaninjaclan 1 year ago
THX ALEx!
dikcokelat 1 year ago
Comment removed
eclassentertainment 1 year ago
my file input thing is setup different from yours, mine has a text area and then a browse... button
Techible 1 year ago
Hello, Alex. i have a question : What are the vid dimentions? (Bad English ;// ) is : 320x240 ? or what? (Sorry for my really bad english)
ExePalikuonis 1 year ago
Yeah. This video almost makes me want to code again.
Acceptable76 1 year ago
@Acceptable76 You say that in every video
UnrealNate 1 year ago
@UnrealNate Eh? I hardly comment. What are you talking about?
Acceptable76 1 year ago
First comment :3
I just wanted to be first on a video ;D;D
xG3kko 1 year ago
And btw, your video's are awesome, I learned alot from it, and now I've made 2 websites that is functional :3
Nice alex (Y)
xG3kko 1 year ago