-
Stopped Watching One file for multiple function, possible?
Hello..im a newbie in php, i'm curious about how to make a single file with multifunction, so i can call this file in another file. For example, i made a … -
Began Watching PHP form with mysql database
Dear friends, Please guide me I want to display data in PHP form from mysql database. my code is below <?PHP //connect to database $username = "root"; $password = ""; … -
Replied To a Post in PHP form with mysql database
Maybe line 23: `while($row=$result->fetch_assco()){...` It should probably be: while($row=$result->fetch_assoc()){... *assoc* stands for associative; this method returns a row in an associative array where field names are keys. -
Began Watching POST using PHP cURL
Hi all! I am trying to post from a form to an URL, using cURL. I have managed to do the posting bit, and my data is coming thew to … -
Replied To a Post in POST using PHP cURL
Can you add a brief description on how you solved it. -
Stopped Watching Not Inserting Data
Hi there I am trying to add some data from a form into a MySQL database and it doesn't seem to been working. Any help would be appreciated. # PHP … -
Stopped Watching Sort array
Hi, I have the below array (or is it called string?) with javascript date and a value. I need to sord the elements by the date but i dont know … -
Gave Reputation to Isaac_4 in Cannot INSERT data into mysql database
Try adding these lines to the top of your PHP script to make sure errors show up: define('DEBUG', true); // change true to false to disable errors showing up if(DEBUG) … -
Replied To a Post in Edit Invoice
Have you managed to correct the above error? -
Began Watching Illegle Offset in cURL and PHP
Hello, I am getting a weird error when i try to run this array: //leafly api keys $appID ='Blah'; $appKEY = 'blah'; //init curl $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://data.leafly.com/strains/".strtolower($data)); … -
Replied To a Post in Illegle Offset in cURL and PHP
It is a lot of code but as it seems the `$image[photos]` is an array of photos that you should iterate through, something like: foreach($cleaned_response as $image){ foreach($image[photos] as $oneImage) … -
Began Watching Cannot INSERT data into mysql database
Hello everyone. I have just bought a new computer and I am currently working on creating an online cloud storage service. Every thing is going fine until I am struck … -
Replied To a Post in Cannot INSERT data into mysql database
Just a few thoughts: - you should check if all the required values exist before using them in the query (otherwise the query might break) - you should sanitize the … -
Began Watching Sort array
Hi, I have the below array (or is it called string?) with javascript date and a value. I need to sord the elements by the date but i dont know … -
Replied To a Post in Sort array
If you want to sort using php then you have to: 1. convert javascript array (of arrays) into php array using [json_decode](http://php.net/manual/en/function.json-decode.php) function 2. sort the php array using [array_multisort](http://php.net/manual/en/function.array-multisort.php) … -
Replied To a Post in Edit Invoice
You have a space in your index name: echo '<option value="'.$data2['level _name']... The space is caused by a line break. Remove the linebreak and everything should be fine. The error … -
Replied To a Post in Edit Invoice
The table structure and data looks OK. It is time to have a look a the generated HTML code. Can you post the HTML code for the *group_level* select element … -
Began Watching Meger array to object
array (size=10) 'item-_token' => string 'k4i2tQbZNuKnhV0vqbdBJ0XlwKzGLm09KA0pWa5n' (length=40) 'item-link' => array (size=3) 0 => string 'link 1' (length=6) 1 => string 'link 2' (length=6) 2 => string 'link 3' (length=6) 'item-shop_name' … -
Replied To a Post in Meger array to object
Something like this might help: $oldArray = array( 'item-_token' => 'k4i2tQbZNuKnhV0vqbdBJ0XlwKzGLm09KA0pWa5n', 'item-link' => array ('link 1', 'link 2', 'link 3'), 'item-shop_name' => array('a', 'b', 'c'), 'item-color' => array('blue', 'yellow', 'black') … -
Replied To a Post in Edit Invoice
As you can see there is no value for group_level. 1. Have you selected any value? 2. Is there a field level_name in the level table? What is the output … -
Replied To a Post in Edit Invoice
You can also put this code on line 58: echo '<pre>', print_r($_POST, 1), '</pre>'; so the content of the post is displayed. Select values and post the displayed debug info … -
Replied To a Post in Edit Invoice
And did you select any level in the dropdown when you were testing? -
Replied To a Post in Edit Invoice
As I said your select element might have no values or no value was selected. You can test for the former by setting a default value as per my post … -
Replied To a Post in Edit Invoice
Have you checked that the select element (`<select name="group_level">...`) has any values? Change default value to something visible (like `X`) so you can check if it gets saved. $group_level = … -
Replied To a Post in Edit Invoice
Put the debug code after the else block: if (empty($_GET['group_id'])) { $sqlstr = "INSERT INTO `invoice`(group_id, group_date, group_package, group_level, group_teacher, group_payment) VALUES('".$group_id."','".$group_date."','".$group_package."','".$group_level."','".$group_teacher."','".$group_payment."')"; } else { $sqlstr = "UPDATE `invoice` SET … -
Replied To a Post in Edit Invoice
What is the output if you put this debug code on line 82: die('<pre>' . print_r($sqlstr, 1) . '</pre>'); -
Replied To a Post in Edit Invoice
Also you can write some temporary debug code to print your query on the screen and then copy and paste it into phpmyadmin (or other DB tool) to check it … -
Began Watching Edit Invoice
This is the first url: http://localhost/SquprimeRevise/administrator/admin/invoice_edit.php?group_id=7&type=new invoice_edit.php <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Squprime</title> <!-- CSS --> <link href="style/css/transdmin.css" rel="stylesheet" … -
Replied To a Post in Edit Invoice
1. You are using double quoted strings so you can simplify things. Instead of: $sqlstr = "UPDATE `invoice` SET group_date='".$group_date."', group_id='".$_GET['group_id']."', group_package='".$group_package."', group_level='".$group_level."', group_teacher='".$group_teacher."' WHERE group_id='".$_GET['group_id']."'"; you can write it: … -
Began Watching One file for multiple function, possible?
Hello..im a newbie in php, i'm curious about how to make a single file with multifunction, so i can call this file in another file. For example, i made a … -
Replied To a Post in One file for multiple function, possible?
Make a file that will contain all your functions, something like functions.php. You can put it in a special folder if you wish (like lib or something). The include this … -
Stopped Watching undefined index warning for drop down list
Hi, so im trying to insert data but i get: > Notice: Undefined index: events html part: <form method="post" action="seating.php> <div class="drop"> <label>Event : <label/> <select name="events" id="dd-events" onchange="getguests(this.value)"> <option … -
Stopped Watching undefined index warning for drop down list
Hi, so im trying to insert data but i get: > Notice: Undefined index: events html part: <form method="post" action="seating.php> <div class="drop"> <label>Event : <label/> <select name="events" id="dd-events" onchange="getguests(this.value)"> <option … -
Stopped Watching undefined index warning for drop down list
Hi, so im trying to insert data but i get: > Notice: Undefined index: events html part: <form method="post" action="seating.php> <div class="drop"> <label>Event : <label/> <select name="events" id="dd-events" onchange="getguests(this.value)"> <option … -
Stopped Watching undefined index warning for drop down list
Hi, so im trying to insert data but i get: > Notice: Undefined index: events html part: <form method="post" action="seating.php> <div class="drop"> <label>Event : <label/> <select name="events" id="dd-events" onchange="getguests(this.value)"> <option … -
Stopped Watching undefined index warning for drop down list
Hi, so im trying to insert data but i get: > Notice: Undefined index: events html part: <form method="post" action="seating.php> <div class="drop"> <label>Event : <label/> <select name="events" id="dd-events" onchange="getguests(this.value)"> <option … -
Stopped Watching undefined index warning for drop down list
Hi, so im trying to insert data but i get: > Notice: Undefined index: events html part: <form method="post" action="seating.php> <div class="drop"> <label>Event : <label/> <select name="events" id="dd-events" onchange="getguests(this.value)"> <option … -
Stopped Watching download image from database
Hello everyone, I want to download an image which was uploaded from the database Here is my HTML codes for the download link <a href='download.php?id=<?php echo $data["LRCard"]; ?>'>Download</a> and here … -
Began Watching Not Inserting Data
Hi there I am trying to add some data from a form into a MySQL database and it doesn't seem to been working. Any help would be appreciated. # PHP … -
Replied To a Post in Not Inserting Data
Your script might work if you change line 2 to: if(isset($_POST['Submit'])) since you usualy check whether the form was submited (but this is more or less just a guess). However, … -
Began Watching undefined index warning for drop down list
Hi, so im trying to insert data but i get: > Notice: Undefined index: events html part: <form method="post" action="seating.php> <div class="drop"> <label>Event : <label/> <select name="events" id="dd-events" onchange="getguests(this.value)"> <option … -
Replied To a Post in undefined index warning for drop down list
If no event has been selected from the dropdown, you are in trouble since $_POST['events'] possibly does not exist and you get a notice (the script obviously gets executed anyway). … -
Began Watching Split Array
Hi can anyone give me an idea on how I can come out with an output like this: $string = string1-1/string3-3/string3-3/ //this is the original string from DB //i want … -
Replied To a Post in Split Array
// initialize output array $outputArray = array(); $tmpArray = explode("/", $aName); foreach ($tmpArray as $tmpString) { $tmpOneRow = explode("-", $tmpString); // add two elements to the output array $outputArray[] = … -
Stopped Watching PHP Dropdown question
hi guys, i wonder if someone could help, i am teaching myself with tutorials and online books etc PHP, ive played around in it before, but due to time i … -
Gave Reputation to Sammys.Man in PHP Dropdown question
Hi urtrivedi, thanks for the idea, i will try that also :) Broj1, code sorted now, it was me being an idiot, trying to code as soon as i wake … -
Replied To a Post in PHP Dropdown question
Maybe you post a little bit more code. At least to see where is the information about the ommittee member that has taken the book in. -
Stopped Watching Adding tabs to format generated HTML
I have the following snippet of function and call to another function for returning tabs to format code. public function makelinks ($urls_data) { ...code... $i = 5; $tabs = $this->echo_tabs($i); … -
Stopped Watching concatenate to form a query string
i have an array names skills in which there are various skills now i wanna create aquery like select * from tablename where skills regexp ""skill1" and skills regexp "skills2" … -
Stopped Watching How to add script :"Are you sure to delete data?"
Hello PHP Friends, I think this is just if else statement problem but im kinda lose to it. The whole code is succesful in deleting the data from database the …
The End.