39,320 Topics
| |
I have code like this, it shows data when tehre is data but if there is no data i want to say "no records" where am i going wrong? [CODE]<?php require_once('db_conf.php'); $sql = "SELECT * FROM tbl_holidayspecials WHERE fld_country = '$countryname' AND fld_state = '$statename' AND fld_city = '$cityname'"; $result … | |
<?php $con = mysql_connect("localhost","root","")or die (mysql_error()); mysql_select_db("registration", $con); function protect($value){ $value=mysql_real_escape_string($value); $value=stripslashes($value); $value=strip_tags($value); } if(isset($_POST['upload']) && $_FILES['file']['size'] >0) { $fileName = $_FILES['file']['name']; $tmpName = $_FILES['file']['tmp_name']; $fileSize = $_FILES['file']['size']; $fileType = $_FILES['file']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); $sql = "INSERT INTO signup_image (name, size, … | |
Hi, i am new here and complete amateur to PHP. I get the above error on line 2. but i don't get it? Can someone help please? [CODE] <?php function bp_dtheme_add_custom_header_support() { $get_current_scheme = get_option('dev_buddydaily_custom_style'); if(($get_current_scheme == '') || ($get_current_scheme == 'default.css')) { $headerpath = "%s/library/styles/images/default_header.jpg"; } else{ $headerpath = … | |
So.. I dont know why i cant find a specific tutorial / tip on this, so i'll ask you guys. I'm trying to get $date to get the current date and insert it as the query executes. [CODE]$result=mysql_query("INSERT INTO articles (`loginid`,`title`,`author`,`body`,`date`,`category`) VALUES ('$loginid','$title','$author','$body','$date','$category')") [/CODE] this is my Database. [CODE]CREATE TABLE … | |
I am trying to update a mysql entry. Getting this error; [CODE]Insert Error: 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 '('loginid='15',title='Test',author='Sorcher',body=' Yeah just testing this aga' at line 1[/CODE] [CODE]if ($_GET['edit']){ $getedit … | |
Hello everyone. I am working on this forum/post/script type thing. What I want to do is convert this example to HTML. [div] [p]Some text[/] [div] Some more text [/] [/] ---> <div> <p>Some text</p> <div> Some more text </div> </div> I don't want to use [/div] or [/p] to keep … | |
I have used if($_FILES['file']['type']) but it does not upload it. Can anyone help me. I'll be thankful t you. | |
Fadein and FadeOut is not supported by IE8. Please let me know any way to fix that. | |
Dear All, In my database I store different vehicles. So each vehicle have different setup of the wheels e.g some 2 infront and 4 at the back some 2 infront and 8 at the back etc. So based on this configuration I would like to programmatically show all the wheels … | |
Good day all: Is there a mechanism through which I can have a button on my html form which on click calls a script that converts the form (or the html page) into a pdf file and inserts the file into mysql table with a specified name originating from the … | |
Alright, so I am creating a website for an upcoming band and they want a website. I was planning on using Wordpress, but ran into problems when trying to display a list of songs. What is the best way to have a page list songs in Wordpress? Do you recommend … | |
I have the login page created that captures the userid & also an edit page that shows all info of a certain table in database. Trying to figure out when a user views the edit page to have it only show the info the user created. Making it only possible … | |
I have two combo boxes, Country and Cities. I user clicks Country Combo box its corresponding value will fetch from DB and fill into its child combo box (also came from DB) | |
how do i acces a persons webcam with php, such as the one from chatroullette | |
It wont work, the script might be messed up, please help / give a hint, i'll rep any help. [CODE]<?php session_start(); error_reporting(E_ALL); //////POST STATEMENTS/////////// $loginid = $_POST['loginid']; $title = $_POST['title']; $author = $_POST['author']; $body = $_POST['body']; $category = $_POST['category']; $dbLink = new mysqli('xxxxx.xxxxxx.com', 'xxxxxxx', 'xxxxxxx', 'xxxxxxx'); if(mysqli_connect_errno()) { die("MySQL connection … | |
Guys, right now i am posting xml to a service running on certain port. my sample code is [CODE] Quote: $XPost = fread($handle, filesize($xmlfile)); fclose($handle); $ch = curl_init(); // initialize curl handle curl_setopt($ch, CURLOPT_VERBOSE, 1); // set url to post to curl_setopt($ch, CURLOPT_URL, $URL); // set url to post to … | |
Hello world, I need your help/advice, I have a table last_acces where inserting a few data. The table columns are: Id Name Date I want to export this data into excel clicking on the link or button from the page. Anyone could help me on this please? The action will … | |
Hello, I would like help in change a bit the following code. It shows google map, but I would like to show google street view. Can you tell me what I need to do/change? I don´t understand very well code. Thanks in advance. This is the code: [code]<?php // =============================== … | |
i would like some help with making my search box work on my forum, at the moment when u type anything in it just refreshes the page and the same page is shown. I want it to show the thread if some types in say 'hello' it should show threads … | |
getting the problem ~ mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /studhome/1/0803087/public_html/RSS.php on line 14 trying to create a RSS feed no idea what is wrong, so can anyone help [CODE] <? // Connect to database DEFINE ('DB_USER', '******'); DEFINE ('DB_PASSWORD', '********'); DEFINE ('DB_HOST', '*****'); DEFINE … | |
i just store session in my register page for use it in different files when someone get registration but i dont know y in other pages when i try to call my session,i get error that the variable are undefined. my code at register.php [CODE] <?php $con = mysql_connect("localhost","root",""); if … | |
I get this error message: Insert Error: 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 'testing this thing again' at line 2 NOTE: the 'testing this thing again' is $body This is my … | |
I'm new to PHP.. I want to know how can you apply a function on a specific value of Array I've attached the code & SQL file, since this codes uses PHP classes, I'm not able to convert my DATE fields while displaying them from the DB & inserting them … | |
i have two sub-domains pointing at the same file.the sub-domain's are test.test.com and fail.test.com and the file is index.php. Now i want to be able to work with both of those domains within the same file so i used this code: [CODE] if($_SERVER['HTTP_HOST']=='test'){ echo"test"; }else if($_SERVER['HTTP_HOST']=='fail'){ echo"fail"; } [/CODE] but … | |
It was not time ago that I realized that those that I consider standards for MVC implementation with PHP are not standards for all. I would be very happy to read different approaches of how to implement MVC architecture with PHP, not just frameworks but the all idea that you … | |
Ok, I currently have three different pages in play here. [LIST=1] [*]Cigar.php - This is the individual cigar page, dynamically generated based on a GET Value [*]Cigarreview.php - This is where a user goes to review a cigar. It has a drop down menu that pulls from the DB and … | |
Hi, I am fetching date from the database which is submitted by user while form filling. The date came from database 2011-11-15. What i want to do,show date in below format. 2011-dec-15 or dec 15 2011 need help?? | |
Please I need help, I don't know what I'm doing wrong here, [CODE] $query=( "UPDATE $tblname SET totwrong =".$wrongAnswers."', SET Test_score ='".$percentage."' WHERE UserName = '".$UserName."'"); [/CODE] It does not update the table, please please | |
Does anyone know how I would go about storing something from my database into a variable to use elsewhere on my PHP code? |
The End.