do not start variables with numbers.

$host='localhost';
$username='myhotspot_crazy';
$password='159995';
$db='myhotspot_lol';
$dbconn = @mysql_connect($host,$username,$password) or exit("SERVER Unavailable");
@mysql_select_db($db,$dbconn) or exit("DB Unavailable"); 
    $159995

    is meaningless. Look up [man]variables[/man] in the manual to see what is and what isn't a valid name for a variable.

      Weedpacket;10897886 wrote:
      $159995

      is meaningless. Look up [man]variables[/man] in the manual to see what is and what isn't a valid name for a variable.

      hey that dbpassword right..............???😕

        I don't know if it's the right password; it's your database. But $159995 is not a valid variable.

          Weedpacket;10897993 wrote:

          I don't know if it's the right password; it's your database. But $159995 is not a valid variable.

          tel me some examples like...........what kind of variable i have to insert here?

            meddycool;10898010 wrote:

            tel me some examples like...........what kind of variable i have to insert here?

            lets create variables like $host, $username, $password and $db. Then you can use them in the mysql connection, example:

            $host='localhost';
            $username='myhotspot_crazy';
            $password='159995';
            $db='myhotspot_lol';
            $dbconn = @mysql_connect($host,$username,$password) or exit("SERVER Unavailable");
            @mysql_select_db($db,$dbconn) or exit("DB Unavailable"); 

              oh...........i am stupid :eek:
              i forget this :queasy::queasy::queasy:

                djjjozsi;10898013 wrote:

                lets create variables like $host, $username, $password and $db. Then you can use them in the mysql connection, example:

                $host='localhost';
                $username='myhotspot_crazy';
                $password='159995';
                $db='myhotspot_lol';
                $dbconn = @mysql_connect($host,$username,$password) or exit("SERVER Unavailable");
                @mysql_select_db($db,$dbconn) or exit("DB Unavailable"); 

                i have done all this still i am getting an error

                Warning: fopen() [function.fopen]: Unable to access book.gif in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 20

                Warning: fopen(book.gif) [function.fopen]: failed to open stream: No such file or directory in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 20

                Warning: feof(): supplied argument is not a valid stream resource in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 24

                Warning: fread(): supplied argument is not a valid stream resource in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 25

                  please take a look for this code in my server

                  click here to see

                  and when u hit the upload button it will display the following error

                  Warning: fopen() [function.fopen]: Unable to access Adriana_Karembeu-2.JPG in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 20

                  Warning: fopen(Adriana_Karembeu-2.JPG) [function.fopen]: failed to open stream: No such file or directory in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 20

                  Warning: filesize() [function.filesize]: stat failed for Adriana_Karembeu-2.JPG in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 21

                  Warning: fread(): supplied argument is not a valid stream resource in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 21

                  Notice: Undefined variable: handle in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 43

                  Warning: fclose(): supplied argument is not a valid stream resource in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 43
                  view image

                      $hndl=fopen($_REQUEST["imgfile"],"r");
                      $isize=sizeof($_REQUEST["imgfile"]); 

                    use this:
                    and imgfile if the name how you set the file field in your form:

                      $hndl=fopen($_FILES["imgfile"]["tmp_name"],"r");
                      $isize=sizeof($_FILES["imgfile"]["tmp_name"]); 

                    But i suggest you do not upload files into mysql database.

                      djjjozsi;10898029 wrote:

                      But i suggest you do not upload files into mysql database.

                      but why ??????????😕

                        djjjozsi;10898029 wrote:
                          $hndl=fopen($_REQUEST["imgfile"],"r");
                          $isize=sizeof($_REQUEST["imgfile"]); 

                        use this:
                        and imgfile if the name how you set the file field in your form:

                          $hndl=fopen($_FILES["imgfile"]["tmp_name"],"r");
                          $isize=sizeof($_FILES["imgfile"]["tmp_name"]); 

                        But i suggest you do not upload files into mysql database.

                        still not working
                        now eror are

                        Notice: Undefined index: imgfile in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 20

                        Notice: Undefined index: imgfile in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 21

                        Notice: Undefined variable: imgdata in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 29

                        Warning: fclose(): supplied argument is not a valid stream resource in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 43

                        check here on my server

                          Try using:

                          <form method="POST" action="/test_imagedb.php" enctype="application/x-www-form-urlencoded">

                          instead of:

                          <form method="POST" action="/test_imagedb.php" enctype="application/x-www-form-
                          urlencoded">

                            bradgrafelman

                            :eek:
                            what the different lol

                              The latter has a line break after the 'form-' part while the former contains no line breaks.

                                nothing happen same result.....................😕😕

                                  Oops! You've managed to confuse even me.

                                  The correct enctype for a POST upload is not 'application/x-www-form-urlencoded' but instead 'multipart/form-data' as explained on this manual page: [man]features.file-upload.post-method[/man].

                                    bradgrafelman;10898044 wrote:

                                    Oops! You've managed to confuse even me.

                                    The correct enctype for a POST upload is not 'application/x-www-form-urlencoded' but instead 'multipart/form-data' as explained on this manual page: [man]features.file-upload.post-method[/man].

                                    yup u r right now one error is left insteadt of five

                                    error is

                                    Notice: Undefined variable: imgdata in /www/obxhost.net/m/y/h/myhotspot/htdocs/test_imagedb.php on line 28

                                    and image is not displaying after upload
                                    please check here

                                        $isize=sizeof($_FILES["filename"]["tmp_name"]); 
                                        $hndl = file_get_contents($_FILES["filename"]["tmp_name"]); 
                                      meddycool;10898030 wrote:

                                      but why ??????????😕

                                      Becouse your images gets into your database, and not on your file-server. (which is the easiest way to work with files)
                                      If you want to make links to the images, you have to call a php file.

                                      On an avarage server the mysql space has its own limits. You can't acces with the simpliest way (for example ftp).