Jump to content

prohor

Members
  • Content Count

    11
  • Joined

  • Last visited

Everything posted by prohor

  1. Thank you @MPM sir, Yes. The image is saved in E drive of my local storage under windows 10 Operating system. and it is well bellow in size of allowed file size. It is only 20KB. How I can set Mysql to upload from local file storage When My server is running under C drive of the same operating system? I also do not know how to find the default folder / directory to keep file and upload. Thank you again sir.
  2. Thank you sir, @Barand, it is a file less than 20KB when Maximum is 1MB set. And what is or how I can find the local directory for WAMP server based Mysql server? " If the secure_file_priv system variable is set to a nonempty directory name, the file to be loaded must be located in that directory. " The image is saved in E drive of my local storage under windows 10 Operating system. Thank you once again sir for spending your valuable time to help me.
  3. Hello sir, I am trying to inset a small image img.png (57.7KB) into mysql database. Table structure is id(int) and image(blob). I directly inserting image can cause problems but I need this for test purpose. I can insert the image using localhost/phpmyadmin but when I try command-line using the following command: insert into image(id,image) values (2,load_file('f:\img.png')); or insert into image(id,image) values (2,load_file('f:\\img.png')); error occurs :- ERROR 1048 (23000): Column ‘image’ cannot be null I am using windws 10 os and WampServer 3.1.7 64 bit. (mysql 5.7.24) Please help.
  4. I am trying to learn php and js. Here I am trying to put a value in php varible from javascript alert message input box but failed. here what I have done so far, // <?PHP and other variable is here.... $number='number'; <script> function number{ if (fail == "") { number = prompt('Please enter Phone Number') if (number == "" || number == null) { alert(' You have not specified the Phone Number. Please try again.'); return false; } else { document.getElementById("number").value; return true; } } else { alert(fail); return false; } } </script> So, actually how I can store the value from js alert to php varible? help me. Thanks for your valuable time and opinion.
  5. I have a webpage with following css properties and html for scrolling text. It is showing properly in desktop view but having problem in mobile view like breaking the full text in two line and 2nd line is partially showing from upper part. I am not finding a way to solve that. please see the image for problem. image link of the problem : https://ibb.co/dj2OvR html code ************************ <div class="NewsFeed" id="NewsScroll"> <div id="text"> <?php $stmt = $DB_con->prepare(" SELECT scrollnotice, id FROM products ORDER BY id DESC LIMIT 0, 1"); $stmt->execute(); if($stmt->rowCount() > 0) { while($row=$stmt->fetch(PDO::FETCH_ASSOC)) { echo $row['scrollnotice']; } } ?> </div> </div> ************************* css code: #NewsScroll{ height: 40px; width: auto; background: rgb(63,76,107); /* Old browsers */ background: -moz-linear-gradient(top, rgba(63,76,107,1) 0%, rgba(63,76,107,1) 100%); /* FF3.6-15 */ background: -webkit-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Chrome10-25,Safari5.1-6 */ background: linear-gradient(to bottom, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3f4c6b', endColorstr='#3f4c6b',GradientType=0 ); /* IE6-9 */ color:red; line-height:30px; overflow:hidden; position:relative; } #text { position:absolute; top:5px; left:0; width:100%; height:30px; font-size:25px; animation-name: slide; animation-duration: 30s; animation-timing-function: linear; animation-iteration-count: infinite; -webkit-animation-name: slide; -webkit-animation-duration: 30s; -webkit-animation-timing-function:linear; -webkit-animation-iteration-count: infinite; }
  6. I am trying to show data using "fetch(PDO::FETCH_desc" for show from descending order but it only works for assoc order like bellow code, how I can show it in descending order? I am new to php and pdo, please help. $stmt = $DB_con->prepare(" SELECT name, id FROM class ORDER BY id DESC LIMIT 1, {$recordsPerPage}"); $stmt->execute(); echo $name; if($stmt->rowCount() > 0) { while($row=$stmt->fetch(PDO::FETCH_ASSOC)) { extract($row); echo $name; } }
  7. Thank you sir, your post helped me a lot. I have now working pagination, but I can not mark the active page with css- I am going through error. I have tried with <?php if($page===$i) {echo ' class="selected"';}?> [/code] with the following code [code] for ($i=1; $i<=$totalPages; $i++) { echo "<span class='navigations_items_span'>"; if($page===$i) {echo 'class="selected"',"<b>Page </b>";}; //echo "<b>Page </b>"; echo "<a href='index3.php?page=".$i."' class='navigation_item selected_navigation_item'>".$i."</a>"; // here I should use class "selected" with above code if($page===$i) {echo 'class="selected"',"<b>Page </b>";};
  8. I wanted to display maximum 12 image in a page and if more is there there will show pages number like page 1, page 2.. I have tried with this code but all images showing in page1 and page2 also showing the same images. How I can limit and show first 12 image in page 1 and next 12 in page 2? Please help with the code I have tried. <?php require_once 'dbconfig.php'; if(isset($_GET['delete_id'])) { // select image from db to delete $stmt_select = $DB_con->prepare('SELECT userPic FROM tbl_users WHERE userID =:uid'); $stmt_select->execute(array(':uid'=>$_GET['delete_id'])); $imgRow=$stmt_select->fetch(PDO::FETCH_ASSOC); unlink("user_images/".$imgRow['userPic']); // it will delete an actual record from db $stmt_delete = $DB_con->prepare('DELETE FROM tbl_users WHERE userID =:uid'); $stmt_delete->bindParam(':uid',$_GET['delete_id']); $stmt_delete->execute(); header("Location: index3.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" /> <title>new</title> <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> <link href="bootstrap/css/navigation.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="container"> <div class="row"> <?php $stmt = $DB_con->prepare('SELECT userID, userName, userProfession, userPic FROM tbl_users ORDER BY userID DESC'); $stmt->execute(); if($stmt->rowCount() > 0) { while($row=$stmt->fetch(PDO::FETCH_ASSOC)) { extract($row); ?> <div class="col-xs-3"> <!-- imgage info uper header sumon <p class="page-header">//<?php echo $userName." / ".$userProfession; ?></p> --> <img src="user_images/<?php echo $row['userPic']; ?>" class="img-rounded" width="250px" height="250px" /> <p class="page-header" align="left"> <?php echo $userName." / ".$userProfession; ?> <br/> </p> </div> <?php } } else { ?> <div class="col-xs-12"> <div class="alert alert-warning"> <span class="glyphicon glyphicon-info-sign"></span> No Data Found ... </div> </div> <?php } ?> </div> <div class="row"> <hr/> <div class="blog_navigation"> <div style="margin-top:20px;margin-left:180px"> <?php $con = mysqli_connect("localhost","root",""); if (!$con) { die(); } mysqli_select_db($con,"shopiteam"); if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; $start_from = ($page-1) * 12; $sql = "SELECT * FROM tbl_users where status='process' ORDER BY albumid DESC LIMIT $start_from, 12"; //$rs_result = mysql_query ($sql,$con); $rs_result= mysqli_query($con,$sql); $sql = "SELECT COUNT(userName) FROM tbl_users"; $rs_result = mysqli_query($con,$sql); $row = mysqli_fetch_row($rs_result); $total_records = $row[0]; $total_pages = ceil($total_records / 12); for ($i=1; $i<=$total_pages; $i++) { echo "<span class='navigations_items_span'>"; echo "<b>Page </b>"; echo "<a href='index3.php?page=".$i."' class='navigation_item selected_navigation_item'>".$i."</a>"; echo "</span>"; }; ?> </div> </div> </div> </div> </body> </html>
  9. I want to change text fields background color only for placeholder text. What will change from "green" to "white" when any text is inserted. I want to keep it different when mouse over it. I wrote a code but text field's background color get's back to geen again after cursor taking away after text insertion. I have a input box in html form <input type="text" id="Editbox4" style="position:absolute;left:50px;top:458px;width:328px;height:30px;line-height:26px;z-index:4;" name="phone" value="" placeholder="Enter Phone Number" > and for css properties: #Editbox4 { background-color: green; color : yellow; } #Editbox4:focus { background-color: #FFFFFF; color: #000000; } #Editbox4:hover{ background-color: white; } #Editbox4:hover::-webkit-input-placeholder{color:yello;} What is wrong, how to fix? Please help.
  10. @ Jacques1 << thank you very much. it solved my problem! <meta charset="utf-8"> was there but your "mysqli::set_charset()" link solved my problem. I added my code and looks like bellow <?php $connect = mysqli_connect("localhost", "root", "", "sumonn"); // this lines solved my problme, changing latin1 to utf8 after connction (start) if (!mysqli_set_charset($connect, "utf8")) { printf("Error loading character set utf8: %s\n", mysqli_error($connect)); exit(); } else { printf("Current character set: %s\n", mysqli_character_set_name($connect)); } // this was the last line of my changed code $sql=("SELECT * FROM `notice` ORDER BY id DESC limit 1" ); $result_set=mysqli_query($connect,$sql); while($row=mysqli_fetch_array($result_set)) { echo $row['notice']; } if (!mysqli_set_charset($connect, "utf8")) { printf("Error loading character set utf8: %s\n", mysqli_error($connect)); exit(); } else { printf("Current character set: %s\n", mysqli_character_set_name($connect)); } ?> Hope it will help others like mine.
  11. I want to retrieve unicode based (Bengali language) data from mysql (wamp server 3 is running). I have inserted data using PhpMyAdmin and can read the font. but when I tried to read using php in html it just shows '?????' ! I know it is creating problem with unicode data. any solution?? how I can handle in PHP when I can read data from PhpMyAdmin ? my code is: for lastest row only PHP Code: <?php $connect = mysqli_connect("localhost", "root", "", "sumonn"); $sql=("SELECT * FROM `notice` ORDER BY id DESC limit 1" ); $result_set=mysqli_query($connect,$sql); while($row=mysqli_fetch_array($result_set)) { echo $row['notice']; } ?> Please help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.