Drag And Drop Insertion In MySql
I'm developing a site in PHP/MySql that requires Ajax for this feature : The user read an article and if ever he likes it he can drag it and drop it into his "basket". Then when he'll consult its account he'll found that article.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drop Down Menus And Mysql Insertion
I'm looking to create drop down boxes for a user to select the date and then have it insert what they select for month, day, year, hour, minutes and insert it into mysql. It needs to be organized in a timestamp like so: 2007-02-28 21:06:40 I've created the drop down boxes and it works pretty well: Code:
File Upload By Drag & Drop
Can anybody tell me how to upload a file by dragging it onto a web page? Using the <input = "file" .....> it is possible to upload files, but files cannot be dragged onto web pages for uploading.. Any suggestions? I found a few Java based stuff but none of them were free.
Fix My AJAX Drag And Drop Code
I've been working on a drag drop system and something happened when I tried to switch the code from a working model to one with another database. The drag drop still works, but the informatin in the database is still not updating. I kind of got aggravated and could not figure out the problem with my 4 months of PHP experience. If anyone would like to look over the code, then go tot his URL and get in touch with me if interested!
Scriptaculous Drag Drop And Database Integeration!
I'm working on a drag and drop feature with the scriptaculous javascript library. And I was wondering if someone could help me! :( Here is some test code. Basically, when someone takes something from the left side and puts it in the right side, I just want to run a database query. I have NO IDEA how to do this because of my limited javascript experience. <script src="http://www.mytuneslive.com/_NEW/MORPH/javascripts/prototype.js" type="text/javascript"></script> <script src="http://www.mytuneslive.com/_NEW/MORPH/javascripts/effects.js?1.7.0b1" type="text/javascript"></script> <script src="http://www.mytuneslive.com/_NEW/MORPH/javascripts/scriptaculous.js" type="text/javascript"></script> <link rel="stylesheet" href="http://www.wiki.script.aculo.us/stylesheets/application.css" type="text/css" media="screen" /> <div style="height:200px;"> <div style="float:left;"> <h3>This is the first list</h3> <ul class="sortabledemo" id="firstlist" style="height:150px;width:200px;"> <li class="green" id="firstlist_firstlist1">Item 1 from first list.</li> <li class="green" id="firstlist_firstlist2">Item 2 from first list.</li> <li class="green" id="firstlist_firstlist3">Item 3 from first list.</li> </ul> </div> <div style="float:left;"> <h3>And now the second list</h3> <ul class="sortabledemo" id="secondlist" style="height:150px;width:200px;"> <li class="orange" id="secondlist_secondlist1"> <span class="handle">DRAG HERE</spanItem 1 from second list. </li> <li class="orange" id="secondlist_secondlist2"> <span class="handle">DRAG HERE</spanItem 2 from second list. </li> <li class="orange" id="secondlist_secondlist3"> <span class="handle">DRAG HERE</spanItem 3 from second list. </li> </ul> </div>
After Mysql Insertion Another Row Is Added
on the site i am developing i have noticed after a database insertion is made, mysql insert another row (but only the id increments by 1) if i insert: id---name---age---country 1 ---Graham---28---Scotland right after this will be: 2 ---blank---blank---blank i checked the inserts carefully it all seems fine, then tried LIMIT 1, with the INSERT INTO but that didn't work, any ideas on what this could be?
Mysql Data Insertion
I am using this script to load a file into the webserver, and store the path in the database. That is working fine. However, when I try to upload other information from the same field I keep getting the field name in the data. Code:
Image Upload & MySQL Insertion
I am having a bit of trouble getting my script to work. I am trying to get a file (image) to be uploaded to a specified path and insert the file name, a timestamp, and id into my MySQL database to later pull the files that I uploaded out from the DB and display them on a page. Could someone tell me what I am doing wrong? It displays the image upload form, just as I want it to, but if you submit the form, it just takes you back to it and does nothing. It doesn't give any errors, upload the file, nor does it insert anything into the DB.
Image Insertion And Retrievel Using Mysql
I've managed to get images inserted in mysql and can pull them out for display, but for some reason it looks as if the bottom 4th of the jpg photos do not show. Is there a space limitation for blobs?
Insertion Of Data Into MySQL Tables By Date?
My assumption is that when you insert data into a MySQL table, the latest data is put on the bottom, and is thus the farthest from the beginning of any search you'd initiate. I assume the search starts at the top-most row (oldest) and works it's way down. Since I'd like to search the latest data, and pull only about 10 rows of data, the most efficient manner would be to have the tables structured such that the newest content was always on top (a date-wise descendent structure). There must be a way to create a table such that any insertion would be put on top. I know I can ORDER BY date when doing a SELECT command, but that would entail searching the entire data set; isn't there a way to define the table ahead of time such that a date/time column is always ranked in descending order?
PHP-MySQL Drop-Down Box
I'm using PHP to dynamically make a drop down box of users in a table. The first row is displayed with all the users. However, on the second row non of the users are listed in the drop down box. It only works on the first.
2 Drop Down List Using MYSQL
I have a model table with the following fields: MODEL_ID, MAKE_ID, NAME. And a make table with the following fields: MAKE_ID, NAME. The first drop down list (make) to select a make of a car i.e. Chevrolet, Ford. When a make is selected, then all the model for that paticular make appear in the second drop down list.
Two Different Drop Downs From MySQL
I have a admin area for a website, and on some part the admin can select options from two different drop down boxes. Now i thought that it would be better to use one Query for both dropdowns. How can i get them together? I now have something similair twice: <select name="series_id" class="dropdownbox" id="series_id"> <option value="0">- select -</option> <?php $db = mysql_connect("localhost", "name", "pass"); mysql_select_db("db_name"); $result = mysql_query("SELECT * FROM series ORDER BY name"); if ($data = mysql_fetch_array($result)){ do { $current_id = $data['series_id']; if($current_id == $id){$selected = "selected";}; echo "<option value="".$data['series_id']."" ".$selected.">".ucfirst($data['name'])."</option> "; } while ($data = mysql_fetch_array($result)); } else { echo ""; }; mysql_close($db);?> </select> I hope it's clear what i mean. I do not make connection twice, but the rest is similair except for the tablename of course.
PHP And MYSQL Drop Down List
I need a script to create a drop down list which has vehicle makes. The vehicle make list should feed a vehicle model list so when I select a make all the models for the make appear in the model list. I have a make table which has MAKE_ID, make NAME and a model table which has MODEL_ID, MAKE_ID and model NAME. I tried using a script using javascript array but wherever I have a query that pulls the NAME from the database there's always a carriage return after the NAME which messes up the javascript array. I'd rather do it all with PHP if possible. If not please give me one that works and I don't have to spend hours troubleshooting.
Generating Drop Down Boxes From Mysql
i'm using php with mysql. i need to be able to extract items out of my database and put them into a drop down box so that the data is dynamic. In this example, i need to get all of the names from the name.office field into a drop down box to be used in further scripts/processess. <html> <head> </head> <body> <? $db = mysql_pconnect ("localhost", "XXXX", "XXXXX"); if (!$db) { echo "error: could not connect to database. please try again later"; exit; } mysql_select_db("XXXXXXX"); $query = "select name from office"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_array($result); ?> </body> </html>what goes here??? i have tried many things and not been able to get it to work.
Mysql Fetch With Drop Down Menu
Im trying to do somekind of dropdown menu taking information from the database but im not quite sure how this could be done with my knowledge. alright so lets say i have a table named: projects SELECT name FROM project. and it will put all the data found in a html drop down menu?
Dynamic Drop Down Boxes With Mysql
I'm working on a database project for a class and am having problems populating select boxes with a field from a mysql table. The first thing that I'm trying to do is pull the field LastName from the table Faculty. Then when the user selects the faculty member in the drop down box, it will then display all of the fields related to that faculty member...first and last name, title, office number etc and allow the user to edit those fields and then resubmit them to the database. However I can't seem to get the drop down box to populate, so if anyone has any suggestions as to how to fix this I would love to hear them. Code:
Drop-down Displaying MySQL Data
I've got this dropdown trying to call the data in...basically, I only want it to show if it is an upcoming event. Past events are hidden away in the archives. I can get it to work if I remove the if ($row['date'] etc, but not with it in. Can anyone spot any errors with my code? Code:
Multiple Drop Down List Problem And MySQL
I am trying to populate around 30 drop down lists via a single query to a mySQL database. The problem is how to make sure that each drop down list only display it's relevant data. for example the table is as follows:
Drop Down Menu Where The Items Are From A MySQL Select Query
I am just starting programming in PHP and wonder if it is possible to have a drop down menu where the items are from a MySQL select query. I am registering people for a weekend seminar and want to have a list of valid weekends to choose from on the form. Any pointers to scripts or PHP references that will help would be appreciated. I am using the book "Build your Own Database Driven Website Using PHP & MySQL" to get me started, but also need recommendations for a general primer to php.
How To Grad Information From Mysql Database With Drop Down Menu's?
i am trying to do is like this website http://www.chippeduk.com/ in the search area (bottom right), where the user selects a make (all fields grab from the database), then selects a model, then they select the fine tune, then they click search this will bring up the information about the car they have chosen. How would i do this, would i use multiple tables and then link them together via an id? i am new to PHP/MySQL but very willing to learn.
Search Drop Down Menu To Choose Mysql Table
I have currently made a simple PHP search script which, when data is entered in a text box and it's submitted, it queries a table in a MYSQL database and returns information. This works. However, I want to have a combo box beside the text box with options to query different tables depending on which item in the combo is selected. At the moment it searches a news articles table by content and title. But I want to adapt the script so that it searches another table which holds information on people for example. It currently gets the item from the text box with the code:
Drop Down Lists Changing Depending On Other Drop Downs
I want to have a drop down system like this one. But without the radio buttons. I want to have 3 drop downs but have no idea how to go about it. I assume I will need to activate some sort of Javascript on the onChange event of the option drop downs.
Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:
SQL Insertion Problem
I am have a little problem with inserting some info into my database. What I would like to do is be able to select the last row of my database because my data is sorted by database the most recent date will be at the bottom of my database. This script is being used for uploading files and when the user uploads files the date is stored with it thats why the date is the most recent at the bottom. Anyways I understand that mysql_num_rows($var); will tell me how many rows of data are in my database. I have tried a million times to use a for loop to get the last row of data. There has to be some way to just extract the last row of data from my database I just dont know how.
Date Insertion ?
I am inserting date in a table as following....is it the correct way ? $dt = getdate(); $day = $dt['mday']; $month = $dt['mon']; $year = $dt['year']; $dt = $year."-".$month."-".$day; $query = "insert into Articles(PostedDate) values('".$dt."')"; $result = mysql_query($query,$con);
Stripping Chars Before SQl Insertion
I have a form with an input box that the user puts in a dollar amount. I dont want them to put a dollar sign or anything else apart from the currency amount (1.00, 1,658 etc). How would I achieve this?
Problem With Ip Address Insertion
This problem is manifesting it self outside PHP at the level of directly typing commands into the MYSQL application itself. Obviously it is going to have the same effect inside PHP. I need escape characters or something but nothing I have tried works. typing the command INSERT INTO table(ip,commentfield)VALUES ("111.222.333", 'old spammer'); results in only the characters 111 appearing in the ip field . It is defined as a char 16 field.
Multiple Insertion Querry
I have an array of data in PHP. I would like to insert each member of the array into it's own row in SQL. The array is of variable length, so it would have to be dynamic code. How would I go about this? Would I stick the SQL querry generation and actual querry into a while loop? This would generate a lot of traffic between the SQL server and the PHP script. The arrays are each over 1000 members long, however, this is an rare admin script that will be run roughly 4 times a year, so I guess it isn't that bad. If possible however, I would like to do it in one querry. Is that possible? I thought I heard somewhere that it's impossible to run more that one querry at once through PHP as a failsafe for users sticking bad data into forms. (ie, you cant do: "querry1; querry2;", you have to do "querry1;" querry it, then do "querry2;"
Insertion Of Data Not In Order
I have a slight problem with inserting data into MySQL tables with PHP. So far, everything that is entered into my form does get inserted correctly, meaning all data is added successfully to their respective columns. However, sometimes when I insert another set of data, it appears on top of the preceding data. The first column in my table is called 'employid', it set to auto_increment and primary. Code:
Stripping Chars Before SQl Insertion
I have a form with an input box that the user puts in a dollar amount. I dont want them to put a dollar sign or anything else apart from the currency amount (1.00, 1,658 etc) How would I achieve this?
String Insertion And Extraction
is there a function to replace a section af a string with another regardless of the values and to do the reverse i.e. $srt1 = "ABCDEFGHIJKLM") $str2 = "XY // insert $str2 in to $str1 [3] and [4] $srt1 = "ABCXYFGHIJKLM") AND $str = $str1 positions [7] and [8] $str = "HI"; I want to do some incripion on text. OR will I have to create something?
Getting Primary Key Value Of Last Database Insertion
I have a very simple issue. I have a bunch of data I'm inserting into a database to create an article. When complete, I want to redirect to the article, but I need the node_id. It just so happens that the node_id is the Primary key and is automatically generated by mySQL at insertion time. Is there an easy way to get the value of the Primary key for the most recent insertion?
Stop Sql Insertion On Every Page Refresh
The page has a form which basically take in a file name, and and upload button does the uploading. the php code at the top of the page takes the file name and insert the name into a database. the problem is: everytime the user presses the refresh button, a new entry is inserted into the database.
Two-Dimensional Array Insertion And Print
1. return results from an Oracle query into an array. there are 3 fields and approx. 2,000 records. 2. insert the results into an array of some type, inside of a loop, obviously. 3. print the results so i can verify the query is working. PHP Code:
Code Insertion + Escape Chars
I'm updating my scripts a bit, and I was wondering how I could insert data in a textarea just by clicking a button. For instance add a Url or a smily ... (just like in these forums when posting) An other question, how do I make sure I don't need to use a to get a ' For instance if I want to add content containing a " ' " I need to write "hello I'm ..."
Preparing Text For Insertion Into Database
I insert text into a MySQL Database using a TEXT field. PHP syntax is: $query = "INSERT INTO data (text_field) VALUES('$text_field')"; The problem is, when the user has an apostroph (like "friggin' cool") in the text, MySQL misinterprets it, and the query is invalid. Is there a PHP function that formats the that input so it can be entered into the database?
Form Calculation Before Database Insertion
My problem is that i want to make a form where will be made calculations and after the calculation are made, the user should press submit and then, all the values from the form should be inseted into a database. My code is writen under these lines, but all I want to do is the value code to be calculated from Nume and Prenume (for example, if the Nume value is 2 and Prenume value is 3, in the form the value of code should be 5. Code=Nume+Prenume, but i don't know how to write to make the calculation in real time. Code:
Today's Date In Database Insertion
How do I insert today's date in a certain database row without using the date() function for a string? For example, when you use PHPMyAdmin to insert a new table row and there's a column with the type "date", it gives you options such as CURDATE, NOW, etc. How would I use that in a database query?
Avatar Script Insertion Vulnerability (Security)
Looking at http://secunia.com/advisories/17295/ , it seems possible to embed javascript in images in a special way. So, if a user provides an avatar or an image url like this pointing to an external site, they will be able to hack accounts. Do you know how this can be avoided? And/or, how sites like vbulletin/phpbb/smf type of applications protect users from this?
Preventing Multiple Data Insertion On Page Reload
I am developing a PHP-mysql database. It is noted that when the browser window is refreshed the data is inserted again in the database. unfortunately there is no unique keys that I can use to verify the existance of the data, so as to prevent the multiple insertion. Is there any other way to prevent it otherthan introducing another field for this purpose and verifying its existance?
Generate An Html Form, To Be Submitted For Insertion To A 3rd Table
1. display a form consisting of radio buttons and check boxes. multiple selection of check boxes per radio button basically. I got this part done, it displays the data in the form which is being pulled from two separate tables. 2. Insert for each check box a record into a third table of the check box and radio button. this is what i have thus far and I'm not really sure why it's not working from what i can see step by step it should be inserting the records, these arrays are the most terrible thing i can think of having to do. Code:
Complicated Email Parse Or Text Extraction And Database Insertion
I am trying to strip some data out of numerous emails and place it in my database. I know that this seems as if it has been done before. But, this is a little different. First, the numerous emails all have a set of data that needs to be extracted and inserted into the database. Some of the data in the email is id, name, address, city, state, zip, company, etc. The catch is that the date is formated and presented differently in each email. Take into consideration the following email examples: - excert from email #1 ID:.............. 12345 Name:............ JOHN DOE Address:......... PO BOX 9999 City:............ Somecity State:........... CA Zip Code:........ 90210 ....
Drop Down Box
I have a drop down box that I have coded to have several values. These values are actually snippets for SQL code. how do I make the drop down box display the selection picked by the user after the page is refreshed?
Drop-down X 5
I am trying to populate a drop-down from a database and repeat this drop-down five times. The first drop-down gets populated but the others don't. I tried to reset the array, but I am still new to PHP and not sure if I am doing correct. Code:
Drop Down Box
The purpose of this application: I need 2 combo boxes, one with months, and one with years. When the user chooses both a month and a year, a page is displayed with certain numbers that are retrieved from a database. Those numbers correspond to the specific month and year. For example, January 1998 produce "12", but February 2001 might display "73". So I guess I'm asking 2 questions. The first is just a general outline of how someone might go about doing this (to see if i'm on the right track in my thinking). The second, and more important question is for someone to please explain to me how do I get the values chosen in the drop down boxes to correspond to specifc fields in a database?
Drop Down Box
i've got a drop down box that is populated by the results of a mysql querie but for some reason it only shows the first word. so if i have the results; test 1 test 2 test 3 it will just display test, Code:
|