39,320 Topics
| |
<?php include 'inc/db.php'; function dateDiff($start, $end) { $start_ts = strtotime($start); $end_ts = strtotime($end); $diff = $end_ts - $start_ts; return floor($diff / 86400); } $q ="SELECT * FROM date"; $p=mysql_query($q); while ($res=mysql_fetch_array($p)) { $start =$res['sdate']; } $qc ="SELECT * FROM accounts"; $pc=mysql_query($qc); while ($r=mysql_fetch_array($pc)) { $elecend=$r['elec_contract_edate']; $gasend=$r['gas_contract_edate']; $elecshow =dateDiff( $start,$elecend ); … | |
hi guys, am trying to make a simple PHP form submission and insert some data to MySQL, my tables are: category: -id -category_name table1: -category_id(FK) -title -description table2: -table1_id(FK) -filetype -filesize -filedate -filename Form: -Date -Title -description -category(drop down) -upload file (get the file info like type,ext,size,filename) Or is there … | |
I am getting this problem when i submit an online inquiry form. How i fix it. My code is(mail.php) : <?php require_once 'admin/common/config.php'; // Read POST request params into global vars $to = "engmizan@gmail.com"; $from = $_POST['email']; $subject = "Online Enquiry / Order Form"; // registration information $name= $_POST['name']; $desig= … | |
| I get this message quite often and it has popped up again here, any ideas as to why? Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\.... on line 76 line 76 is this line in bold. [CODE] $productlist = ""; $sql = mysql_query("SELECT * FROM products … |
<?php $system_date = Date(m/d/Y); <input type = "Date" value = <? echo $system_date; ?> ?> I want to set system date to above date box.But this will not work.If I change type to text then it will work as I want.What is the problem here.How can I set system date … | |
I have a page to add products. On this page is a 'categorey' dropdown and a 'subcategory' dropdown. The subcategory dropdown should fill with the options based on the category dropdown selection. The code I have so far does not fill the subcat dropdown, can anyone see a problem? code … | |
hey guys... i know this is a very common problem and has been posted earlier also... but nobody seems to have figured out a solution... i am making a program using PHP/MySQL. I need to update 3 columns in a table. when i use a single UPDATE-SET command(using commas/AND etc … | |
How to do the code for design and develop an PHP/MySQL application involves insert, view, search, delete, update/modify a record from a database | |
NB: I'm a beginner at php programming. Hi, I've been trying to add an 'Online' or 'Offline' plugin to my login system. To display the username you use thr following: $session->username In the database, I have a table for active users. When a user logs in, he is added to … | |
Hello, I am trying to create a website with spacechatting. Is there any way to build a website with spacechatting besides yahoo messanger. Is there a free one? If there is no free software, how much approximately? A free software/script is prefered. | |
Hello. I have a little complex code for a navigation menu. I want to add a dropdown to a <li> tag but it doesn't work. Heres the code <div id="topbar" class="fadeInOnLoad"> <div class="inner-topbar"> <ul> <?php if(currentPageName() == 'index.php'){ echo '<li class="">Home</li>'; }else { echo '<li><a href="index.php">Home</a></li>'; } if(currentPageName() == '../about.php'){ … | |
Gyz i have some serious prob my code. if you find any error plz correct me . My code for Pay Fees (Update) <div id="wb_Form1" style="position:absolute;width:365px;height:270px;"> <form name="update" method="post" action="./Update_Fess.php" id="Form1"> <div id="wb_Text7" style="position:absolute;left:10px;top:15px;width:104px;height:16px;z-index:1;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">ISPID#:</span></div> <input type="text" id="Editbox1" style="position:absolute;left:124px;top:15px;width:198px;height:23px;line-height:23px;z-index:2;" name="ISPID" value=""> <div id="wb_Text9" style="position:absolute;left:10px;top:45px;width:104px;height:16px;z-index:3;text-align:left;"> <span style="color:#000000;font-family:Arial;font-size:13px;">August 2013:</span></div> <input type="text" … | |
Design PHP/MySQL application that involves insert, view, search, delete, update/modify a record from a database. "The application is mylibrary and we have to insert, view, search, delete, update/modify the isbn(length:13) and title of the book (length:128)" Can someone show me the code ? I already done mine but I want … | |
I am trying to read XML file and store in sql table. I got two errors. PHP Warning: XMLReader::open(): Unable to open source data Warning: XMLReader::read(): Load Data before trying to read // In addition, Please let me know the filename in below cases. case 1: Code: Select all $reader->open($topdir."/nap/".$code->no()."_city.xml"); … | |
Hi guys, I've created a simple plugin for Wordpress that interacts with an API in the backend. The problem is that everything is inserted twice in the database, and I cannot figure out why. The form is submiting only once, not twice. What could it be ? Redirects from my … | |
<!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"> <!-- DW6 --> <head> <!-- Copyright 2005 Macromedia, Inc. All rights reserved. --> <link rel="shortcut icon" href="/favicon.ico" > <title>LADOKE AKINTOLA UNIVERSITY OF TECHNOLOGY|INFORMATION TECHNOLOGY AND COMMUNICATION(LICT) - Registration</title> <meta name="Author" content="Address for the School of Nursing Ogbomoso Oyo State" /> … | |
Hi Guys i am developing a system in php using codeigniter framework, in this i retrived result from database it stored in an variable and its var_dump result is like var_dump($cat_data) object(stdClass)#21 (4) { ["id"]=> string(1) "1" ["name"]=> string(8) "Computer" ["image"]=> string(1) "0" ["p_cat"]=> string(1) "0" } when i try … | |
Good Day Everone Just wanna ask for a suggestion if it is possible to Save data in DB and at the same time Print the form when the submit button is clicked? and if possible how can i obtain it? Here's what ive tried form.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML … | |
I learned a new technique (from Chris Coyier), and I thought it may be helpful for you guys. Some of you guys may find this helpful if your creating a preview/demo page and you want to go back to original page. This could help you guys. <?php $return = htmlspecialchars($_SERVER['HTTP_REFERER']); … | |
Hello! I need help about fwrite option ,i have this script and need write everytime that $id , but my problem is when the script have another id delete the first one and rewrite the new one.i need to have old and write the new without rewrite the old $id.Thank … | |
I am reading a CSV file and need to add the information into an existing database. I am able to read and display the information correctly. When I try the code below, I get the error *"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line … | |
I have the following code but when $newstring echos out as '.-ucwords(strtolower(-['First.Name']))-.-'-'.-ucwords(strtolower(-['Last.Name']))-.-.php It should echo out the fields from the database noy just that code. If someone could help please $txtname = "'. ucwords(strtolower($row ['First.Name'])) . '-'. ucwords(strtolower($row ['Last.Name'])) . "; $newstring = str_replace(" ", "-", $txtname); while($row = mysql_fetch_array($result)) … | |
hi i would like to know how i can stop multiple form insertion. What i mean is after you submit a form if you refresh the browser sends the script again. I done this with the header() function to resend the user but i also need to show a message … | |
Hi, I'm modifying a login script; I added an avatar system and now I get an error: Parse error: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) in /home/promanx2/public_html/include/session.php on line 455 The whole code of that page is here. <?php /** * Session.php * * The Session class is … | |
Hey everyone, Having a few problems: 1. It's not populating the dropdown with all the entries (But in the delete function it is, which is a somewhat copy) 2. It doesn't post the Employer name, the result I'm getting is "Editing user: *BLANK*" Here is the code: function JobBoard_admin_edit() { … | |
<?php $query = "SELECT studinfos.lname, studinfos.fname, studinfos.mname, studinfos.suffix, studenroinfos.yearLevel, studenroinfos.sy FROM studinfos INNER JOIN studenroinfos ON studinfos.idNumber=studenroinfos.idNumber WHERE (studinfos.idNumber='$searchString') OR (studinfos.lname='$searchString') OR (studinfos.fname='$searchString')"; $result = mysql_query($query); echo "<table border=0 style='border-collapse: collapse' width=95%>"; while ($record = mysql_fetch_array($result)){ $name= $record['lname'].', '.$record['fname'].' '.$record['mname'].' '.$record['suffix']; /* when sql is modified already i can insert … | |
Hi there, I have a really irritating site problem that I just can't get my head around. I only have fairly basic coding skills and hope that someone here can help crack my issue. I own a small php/mySQL based job board which I have moved from hosting to hosting … | |
Hello Guys. I need your help, I dont know why the input of my code like this, I have a database which is upload, then categorize by Personal, Animals, And Natures. When I choose Personal i want to show all image in Personal, but my code doing like this, when … | |
This is the code I am using but it keeps giving me this error: Failed to run query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near … |
The End.