39,323 Topics

Member Avatar for
Member Avatar for johnef_sh

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 …

Member Avatar for phorce
0
576
Member Avatar for Synestic

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 …

Member Avatar for blocblue
0
94
Member Avatar for JayJ

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' => …

Member Avatar for JayJ
0
151
Member Avatar for logicaweb

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 …

Member Avatar for logicaweb
0
241
Member Avatar for Sanchixx

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'] ." …

Member Avatar for almostbob
0
306
Member Avatar for pritaeas

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.

5
4K
Member Avatar for Khav

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 …

Member Avatar for diafol
0
253
Member Avatar for subhu01990

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 …

Member Avatar for ome2012
0
322
Member Avatar for adishardis

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 …

Member Avatar for adishardis
0
1K
Member Avatar for bettybarnes

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 …

Member Avatar for diafol
0
251
Member Avatar for Headshot_Harry

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 …

Member Avatar for theHop
0
597
Member Avatar for dhirst1

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 …

Member Avatar for dhirst1
0
252
Member Avatar for muhammad.waleed.9699

<!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> …

Member Avatar for ainosilva
0
201
Member Avatar for LastMitch

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 …

Member Avatar for LastMitch
2
194
Member Avatar for pritaeas

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 …

3
860
Member Avatar for saadi06

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 …

Member Avatar for blocblue
0
106
Member Avatar for natehome

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 …

Member Avatar for cereal
0
152
Member Avatar for code739

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,

Member Avatar for singhboy
0
199
Member Avatar for alpha2006

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

Member Avatar for chrislim2888
0
2K
Member Avatar for showman13

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 …

Member Avatar for pratziyer
0
143
Member Avatar for BadManSam

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 …

Member Avatar for retrax57
0
102
Member Avatar for hitesh.shah.397

`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 …

Member Avatar for hitesh.shah.397
0
86
Member Avatar for HunainHafeez

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

Member Avatar for ome2012
1
113
Member Avatar for HunainHafeez

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 …

Member Avatar for slyme
0
208
Member Avatar for Goldfinch

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 …

Member Avatar for blocblue
0
42
Member Avatar for HunainHafeez

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' …

Member Avatar for jstfsklh211
0
247
Member Avatar for Hypalink

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 …

Member Avatar for blocblue
0
211
Member Avatar for ronak.patel.946

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 …

Member Avatar for jstfsklh211
0
260
Member Avatar for sammry

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, …

Member Avatar for sammry
0
128
Member Avatar for eburlea

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? …

Member Avatar for AndreRet
0
636

The End.