<?php include '/classes/image_class.php'; $obj_image = new Image(); if(@$_POST['Submit']) { $obj_image->image_name=str_replace("'", "''", $_POST['txt_image_name']); $obj_image->image=str_replace("'", "''", $_POST['txt_image']); $obj_image->Insert_into_image(); $data_image=$obj_image->get_all_image_list(); $row=mysql_num_rows($data_image); } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>NOvaeye </title> </head> <body> <CENTER><H1>Novaeyewear</H1></CENTER> <CENTER><H2>Sunglass</H2></CENTER> <CENTER> <form method="post" enctype="multipart/form-data"> <table border="1" width="80%"> <tr> <th width="50%">IMage NAme</th> <td width="50%"><input type="text" name="txt_image_name"></input></td> </tr> <tr> <th width="50%">Upload IMage</th> <td width="50%"><input type="file" name="txt_image"></input></td> </tr> <tr> <td></td> <td width="50%"><input type="submit" name="Submit" value="Submit"></input></td> </tr> </table> </form> </CENTER> <?php if($row!=0) { ?> <center> <table width="80%" border="1"> <?php $icount = 1; while($data= mysql_fetch_assoc($data_image)) { ?> <tr> <td><?php echo $icount; ?></td> <td><?php echo $data['image_name']?></td> <td><img src="/gallery/images/<?php echo $data['image']; ?>" width="400px" height="200px"></td> </tr> <?php $count++; } ?> </table> </center> <?php } ?> </body> </html> 

  <?php include 'db/db.php' ; class Image{ var $image_id, $image_name, $image; function Insert_into_image(){ if(isset($_FILES['txt_image'])) { $tempname = $_FILES['txt_image']['tmp_name']; $originalname =$_FILES['txt_image']['name']; $size =($_FILES['txt_image']['size']/5242888). "MB<br>"; $type=$_FILES['txt_image']['type']; $image=$_FILES['txt_image']['name']; move_uploaded_file($_FILES['txt_image']['tmp_name'],"images/".$_FILES['txt_image']['name']); } $query = "Insert into t_image_upload ( image_name, image ) values ( '$this->image_name', '$image' )"; if(mysql_query($query)){ echo "Insert success"; } else { echo "Insert not success"; } } function get_all_image_list(){ $query = "select *from t_image_upload"; $result = mysql_query($query); return $result; } } ?> 

We write request Does not process Russian language

Chip in what

Here I have a system for uploading pictures to the server (GALLERY). And you can add a caption to the loaded picture.
In this case, I have written "EXAMPLE" and when I send a request, it clogs it into the database, but in the database itself (PhpMyAdmin) you can see what he wrote down "#" tobish the Russian language, so to say, does not see, and English without problems . What is the trouble?

  • Try printing var_dump($query); and see if everything is normal with him. This will make it clear if there is a problem with the base or somewhere before - rjhdby
  • No, I am from Latvia) - user234201
  • one
    Try using phpMyAdmin to add a value with Cyrillic. Perhaps your database encoding does not support Cyrillic - br3t
  • Yes, you were right. All because of the encoding) Paldies! - user234201

0