39,323 Topics
| |
Hey, I'm running a mysqli query, and would like to run a script if the query returns no results. this is my code <?php $SM_pro_info="SELECT * FROM special_marketing_ads ORDER BY id desc LIMIT 4"; $QSM_pro_info = $db->query($SM_pro_info)or die($db->error); $SM_pro=mysqli_fetch_array($QSM_pro_info); if($SM_pro){ while($SM_pro=$QSM_pro_info->fetch_object()){ ?> <table width="208" border="0"> <tr> <td width="129" height="35" align="right"><span … | |
Hi What would be the best practice to format my text in MySQL without messing around in php? For example, I have a description: TECHNICAL FEATURES: Anti static, dust repellent,... COLOURS AVAILABLE: - WHITE - BLACK I'm copying everything from my old website (html-only) into my database, and this is … | |
Hi, I'm using InvisionPB to construct a query and basically generate a custom table. The following is what I have. I can get the query to echo prior to the switch/case but can't get it to display within the case itself. Any ideas? $this->DB->build( array( 'select' => "m.name", 'from' => … | |
Hello, I'm trying to create exchange rates list with the data source of my National Bank, and my national Bank make it very complicated, data are stored with SOAP, and first of all I made rate.php that pull and show all data from web service od National Bank but like … | |
I have a chat script but when you submit it without writing a message it submits the only the name of a person. How can i stop this? here is the code : <? session_start(); if(isset($_GET['logout'])){ $ip=$_SERVER['REMOTE_ADDR']; //Simple exit message $fp = fopen("log.html", 'a'); fwrite($fp, "<div class='msgln'><i>User ". $_SESSION['name'] ." … | |
Below is a documented code example showing how to use the [MySQLi](http://php.net/manual/en/book.mysqli.php) (MySQL improved) classes/objects to connect and query your database (and check for errors). If there are any questions, or you want to see different features, let me know. | |
Hello guys I want to make my file upload form appear similar on all browser.I current use the code below.This will show differently depending on browser <form action="upload.php" method="POST" enctype="multipart/form-data" > <input type="file" name="image"/> <p><button name="submit" type="submit"></button></p> This is not a secret to anyone:D How can i make the following … | |
pagelisting.php............. <html> <head> <h3 style="text-align:center;background-color:yellow">THIS THE LISTING PAGE</h3> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <?php include("home.php"); ?> </head> <body> <form action="" method="post" name="form1"> <br/><br/> <a href="fillup.php"><tr><th>Contacts</th></tr></a> <br/><br/> <input type="text" name="searchtext"/> <input type="submit" name="submit" Value="Search"/> </body> </html> <?php include("database.php"); $var=$_POST['searchtext']; if(isset($_POST['submit'])) { $sql="SELECT * FROM information WHERE fname LIKE '{$var}%'"; $q=mysql_query($sql) or die("some … | |
Hi, I'm working on a site and but have come to an halt. http://adam.synology.me/help1.png today I have a dropdown list (circled in red) which lets the user choose a row of data from my database to visualize in the area to the right in various graphs and such. I would … | |
Hello everybody, I know it's a beginner's question (since I'm new to PHP), my question is how do you deploy your PHP website on the Web? Do you know any tool to host my site? This site FYI is a simple forum, that is to say, it's database-driven. So I'm … | |
Hi all, I have a terribly frustrating issue I'm trying to solve and wondered if anyone would be able to help? I have a simple HTML / CSS website hosted on my webserver. This website has a basic web contact form that allows a user to fill in their details … | |
Hi all ive some ajax posting to the same php file to submit the post data to the database, the form data is posting, it just isnt following on to the database :/ way it currently works is that ive a form that submits the form to the PHP then … | |
<!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> <title>Untitled Page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <h2>Student Clearance Information</h2> <form action="students_clearance.php" method="post" name="form1"> <table> <tr> <td> Department Id:</td> <td> <select id="Select1" name="department" > <option>Select Department</option> <option value="IIT"> IIT </option> <option "IMS"> IMS </option> <option "BSChe"> BSChe </option> … | |
| Hi I'm trying to figure out how to `<input> $radius` and `echo $pi` without using a **DB**. This is a simple example how this calculate `$pi` which you can run and see how it works: <?php $pi = "3.1415927"; $radius = 8; echo $pi * ($radius * $radius); ?> The … |
Below is a documented code example showing how to use the [MySQL functions](http://php.net/manual/en/book.mysql.php) to connect and query your database (and check for errors). Please note that using the MySQL extension is **NOT RECOMMENDED**. This extension is no longer maintained and will be deprecated soon. If you want your scripts to … | |
Hi, I have a problem in making a query to make virtual columns in my query. I want to make a query that makes virtual column. for example I have a table with columns a,b and c and I want to make a query something like this SELECT a as … | |
hi, i'm working with php short hand for the first time and i'm trying to edit this code: <?=($c->is_admin == 'Yes')?'<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>' : ' <p> This is not the page you were looking for. </p> ' ?> i want to do something … | |
Hi guys, Could somebody help me in decrimenting the letters cause code like below exists $let = 'A'; for($x=1;$x<256;$x++){ echo $let++.'-'; } //output: A-B-C-D-E....... i just wonder how about decrimenting it like $let--; but it didnt work does anayone has the idea on how to generate $let-- thanks, | |
Hi, I am looking for a PHP script that can take an ip address and return the country where that ip address belongs to. If you know or have been using such a script, please let me know. Thanks | |
Good Afternoon... I have an email function that I have been using for a long time to send mail to our membership. But now I need to be able to send a .pdf as an attachment to them. I expect that it should be a pretty simple process, but no … | |
Hi, I want to create a log file so when someone logs in or when someone gets their password wrong or someone tries to log in to the admin account and gets it wrong, like ip address. date|Time etc The script I am using is this one http://angry-frog.com/downloads-page/ PHP Login … | |
`Inline Code Example Here`hello everyone, i am working on a project , in this as all other project we have a login required so i designed a login panel but when i run the project the textboxes of username and password are having its value as "admin",i tried a lot … | |
some one told em that php doesn't support sending and recieving email via localhost even if i have internet connetion ? is it true ? or if not then what is the solution ? thanks | |
i have a table in Mysql's database, tblStudents, which has 1,000 stdents, from different departments, e.g 500 from IIT, 300 from IMS, 100 from Medical, 100 from Engineering. and on fornt end in, i have 2 dropdown boxes, one drpdwnDown box is filled with values, IMS, IIT, MEDICAL, ENGINEERING. now … | |
I'm trying to get php to return the name of a directory like this: http://www.foobar.com/example.php where example.php returns the name of the current directory as "" or "/" and http://www.foobar.com/example_folder/example.php where php reutrns the name of the current directory as "example_folder" or "/example _folder" I found that getcwd() returns the … | |
I am working in php along with Mysql in backend, why this query is giving error : You have some problem in mysql syntax, check manual, this is that query: $Userid= $_SESSION['userid']; echo $Userid; $Dep = "select departmentName from department where userid='$Userid' "; $qry ="select registrationNo,name,fatherName,cnic,gender,discipline,department,admissionSession,email,password,address,domicile,contactNo,status,currentEmployer,designation,salaryInfo,totalExperience,lastOrganizationname,organizationAdd,organizationPhno,organizationEmail,Remarks from students where registrationNo='$RegNo' … | |
Hi guys, im trying to find out the best way to set a unique session variable. Normally I would use a "username", but this project does not need a login script or users table. Whats the best way to create a unique session so that I can echo out the … | |
I know little bit of php-mysql and web programming. For my project work, i made one login module, it contains two pages but it has some errors. I use WAMP for project, whenever i feed data and press login it does not go to profile.php page and session does not … | |
i have 2 tables as follow sales (table1) sales_id, userid(buyerid), product id, productname, orderid, status users (table2) userid, username, pass Now, I need to display the top customer who makes regular purchase on my shopping site. How can I achieve this? I tried as SELECT A.(*), B.username FROM sales A, … | |
Good day, I've created a webpage on localhost using php. I have a local network with 3 computers at home. I can access the webpage only from one computer (http://localhost/mywebpage/). What changes should I make in phpmyadmin to be able to access the webpage from all computers? Is it possible? … |
The End.