39,326 Topics
| |
| Hey everyone, I have a question about prepared statements for PHP and mySQL. I have been able to do them for a single row such as ID and such for a particular object, but is it possible to do a SELECT all command as well? I want to be able … |
I have a member table from which I'm trying to create a query using these fields mem_id / username / create_date / mem_status / ref_id / qualify_id A new member is mem_status 'F' with ref_id equal to the mem_id of their referrer and qualify_id of zero When the member upgrades, … | |
I've created a new member for a website (that I'm making for myself) to see if it works and when I register, I can get in, but when I go to log in after, it won't let me log in and I can re-create the same member multiple times. The … | |
| Hey everyone, I have created a PHP web application that allows people of different permissions to do certain things such as read-only, add, update, or delete. That works pefectly. However, it came across my mind that I have not done anything to prevent against SQL injection or XSS attacks. I … |
I have below code for getting the sundays. any body me to get saturdays $start = new DateTime('2013-01-06'); $end = new DateTime('2013-01-20'); $days = $start->diff($end, true)->days; $sundays = intval($days / 7) + ($start->format('N') + $days % 7 >= 7); echo $sundays; | |
I have two dates like $date1 ="2016-05-01"; $date2 ="2016-05-31"; how to get saturday and sunday count like between range is 9 | |
Below is my code function getWorkingDays($startDate, $endDate){ $begin=strtotime($startDate); $end=strtotime($endDate); if($begin>$end){ echo "startdate is in the future! <br />"; return 0; }else{ $no_days=0; $weekends=0; while($begin<=$end){ $no_days++; $what_day=date("N",$begin); if($what_day>5) { $weekends++; }; $begin+=86400; }; $working_days=$no_days-$weekends; return $working_days; } } $beginday=date("2016-04-01"); $lastday=date("2016-06-30"); $nr_work_days = getWorkingDays($beginday,$lastday); echo $nr_work_days; ?> above code is giving count … | |
$city = "Amersfoort"; if ($stmt = $mysqli->prepare("SELECT District FROM City WHERE Name=?")) { $stmt->bind_param("s", $city); $stmt->execute(); $stmt->bind_result($district); $stmt->fetch(); printf("%s is in district %s\n", $city, $district); $stmt->close(); } This brings many questions: - What is `s` on the line 4? Do I need to bother with that? - What if I … | |
hi, all i am new in php developing i need to know how i could make a user data hidden or inactive to the viewer of my website without deleting this user data from my database can i do that using php code? if yes what is this coding criteria … | |
Hello guys. I am currently developing a Case Management System with a versioning function. The versioning function will allow top management to see the different versions of a document and the different changes that were made by either the lawyer or top management. My problem is, how would I start … | |
Hi, In an excel file, I have 10 headings and that file contains more than 6000 records. I upload file using oleread.inc and excelreader file. It takes time to upload recods in table minimum 4 - 6 minutes. How to decrease the time and insert records in table fastly. | |
I'm getting two errors detailed below: Notice: Undefined index: username in C:\wamp\www\member.php on line 8 Call Stack # Time Memory Function Location 1 0.0006 131808 {main}( ) ...\member.php:0 ( ! ) Notice: Undefined index: passwd in C:\wamp\www\member.php on line 9 Call Stack # Time Memory Function Location 1 0.0006 131808 … | |
I have this code session_start(); $username = $_SESSION['username']; function getUserRole($username, $roleid){ $con=dbConnect(); $query="select * from user inner join userrole on user.id = userrole.userid inner join role on role.id = userrole.roleid where username = $username"; $sql=$con->prepare($query); $sql->bindValue(':username',$username); $sql->bindValue(':roleid',$roleid); $sql->execute(); $row = $sql->fetch(); $username = $row['username']; $roleid = $row['roleid']; if($row > 0){ … | |
I think this is called "foreign key" and "local key" ? I have a table `users`, these users have `rank`. It's an `int`. There is a table named `rank`, this table has field where hexadecimal string is placed `FF0000`. Is there a way to `SELECT * FROM users` and `SELECT … | |
| Hey everyone, I have a question about a database design that I have right now. The template I was given from someone is the first attached that you will see. I looked at it and figured that the database design of that is not the best, so I decided to … |
TAXONOMY MENU SUB CATEGORY CREATION: Problem: I'm trying to create and display menus in the below format using taxonomy(category,subcategory).I have also created Views to fetch the taxonomy values. (See attached taxonomy.png) Menu1 -- > Menu2 ---> Menu3 Menu4 Menu5 Menu 6 Now when executed, I'm not getting the correct format … | |
Hi all, Submitting forms to PHP is easy with Ajax. But what if I wanted to design my website to allow for JS-free web browsers? If I call a PHP file with Ajax, I might get an error message in return to dynamically add to the page, but if I … | |
Hi, I have a page for sending SMS by selecting anyone organization, By selecting organization, it will calculate how many customers are there to send SMS, It will display the SMS Count along with all managers names using JQUERY AJAX. For counting this value,it takes so much time in online, … | |
Sir, please help me to locate the error, if user not found or wrong user name password etc then all codes work fine but when I enter correct user name and password then no result. <?php session_start(); require_once("includes/connect.php"); require_once("includes/functions.php"); if(isset($_POST['login'])) { $muser=clean($_POST['username']); $mpass=clean($_POST['password']); if(empty($muser)) { echo ('<script type="text/javascript">alert("User name must … | |
I have multidimensional array that include department and category. Based on the selecting department and category, i need to search names. below is my code $shop = array( array( "emp_name" => "ramu", "department_name" => "cse", "Number" => 15 ), array( "emp_name" => "ramesh", "department_name" => "eee", "Number" => "56", ), … | |
Hi guys I was hoping you could help I would like to add 10000 records in mysql db.All once with after running a single php script. in one of the fields should generate 10000 rand generated numbers. Any suggests would really help. I was thinking of a for loop. [CODE] … | |
any body help me to convert php multi dimensional array to php multi dimensional array format $data = array( array( "emp_name" => "ramu", "department_name" => "cse", "Number" => 15 ), array( "emp_name" => "ramesh", "department_name" => "eee", "Number" => "56", ), array( "emp_name" => "ravi", "department_name" => "it", "Number" => … | |
| Hey everyone, I have a question. I have a web app where you have a table that will either update, delete, or add a user. The update works great but the delete is weird. It deletes just fine, but I ask for a confirmation first before the action is completed. … |
Dear Experts, I have following codes while($res = mysqli_fetch_array($result)) { echo "<tr onMouseOver=this.className='highlight' onMouseOut=this.className='normal'>"; echo "<td align='center' width='10%' >".$res['code']."</td>"; echo "<td align='left' width='50%' >".$res['products']."</td>"; echo "<td align='center' width='20%'>".$res['weight']."</td>"; echo "<td align='center' width='20%' ><a href=\"master_u.php?id=$res[id]\"><img src=images/pencil.png alt=Edit title=Edit></a> <a href=\"delete.php?id=$res[id]\" onClick=\"return confirm('Are you sure you want to delete?')\"><img src=images/delete16.png alt=Delete title=Delete></a></td></tr>"; … | |
I know this is very basic but i am not able to get the fuction return a string. Instead it is returning the value 1. Below is the code: <?php function getUserRole($username, $roleid){ include "data.php"; $con=dbConnect(); $query="select * from user inner join userrole on user.id = userrole.userid inner join role … | |
i have a wcf service running, the problem am facing is how do i use the wcf to connect to the client and generate reports. if am no a wrong path please help thank | |
My code here suppose to grab list of injection string from table:* injection_text*, column: *injection_code* and inject it at the tail of the URL's crawled by my program, the URL's crawled are stored table: *pages_crawl*. my program suppose to display the result of the injection. the purpose of this program … | |
| Hey everyone, I have a question. I created a page that pop-ups when a user clicks a link and that page displays a table of the information that it pulls from the database that I have created. I want to be able to have a user click an update button … |
Hi, I have many records in my table minimum 3000k records. When I select SMS Page , it has two ajax pages, for calculation, So, the SMS Page is taking so much time to complete the task. I want to reduce the time of this page without affecting anywhere. How … | |
Hi I am trying to do the same thing. I would like to save the Facebook user timeline details OR messages in MySQL database. Timeline details are visible in screen total posts are like this http://screenshot.co/#!/2dcbee03ff , if I want to see the 'messages' only I can see in the … |
The End.