Pull Data From Database And Show It In Forms
I have created an online survey form for my boss about one of his course. He needs his students to do the evaluation for a topic when he finishes each topic. For example, when he finished topic 1, he told students to evaluate topic 1.
Two weeks later, when he finished topic 2, he asked the students to evaluate topic 2, so on. I created the survey form with radio buttons and I would like each student can keep his own record for the previous topic. For example, when it is time to do the evaluation for topic 2, when he opens the survey form, he can see his reply for topic 1. Code:
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Pull Data From MySQL Database
I'm running a PHP script called phpOnDirectory on thsi website i'm creating so that people can have their companies listed in our directory. Currently, the script displayes the directory in a left-hand column, and the results in the center column. When you access a category, the script displays the number of listings withing that category in parenthesis next to the title. What my client wants is to take that out(easy enough) and have the totals listed next to the categories on the left. Code:
View Replies !
View Related
Main Page Database Seems To Not Pull Any Data At All.
I have a page that has a connection to a database. I also call a function that makes a connection to a new database, outputs some data and closes. The problem: When I call the function, the main page database seems to not pull any data at all. Im using all new database connection variables and closing them. Still the main connection stops working.
View Replies !
View Related
Pagination Query - Pull The Data From The Database
I'm trying to paginate some query results but when I click on "next" to go to the next set of results, the query fails. Here's what I'm using to pull the data from the database. PHP Code: $sql="SELECT id, student_id, first_name, last_name, address, city, state, zip, DOB, gender, grade, aka FROM student WHERE last_name LIKE '".$_GET['last']."%' and current_student='yes' ORDER BY last_name LIMIT $offset, $rowsPerPage";     $conn = db_security_connect();     $result = mysql_query($sql,$conn);     $query   = "SELECT COUNT(*) AS numrows FROM student WHERE last_name LIKE '".$_GET['last']."%' and current_student='yes'";
View Replies !
View Related
Pull Data From The Database And Generate A Normal Text File
I have a database that is correctly storing characters like the trademark symbol, copyright,ect. I then pull data from the database and generate a normal text file from it. I do not do anything other then echoing out the direct database info into a variable and then building the file from the variable. When I open the text file, ALL my trademarks, copyright, apostrophies, anything other then alphanumeric becomes question marks. "?" I have no idea how to fix this. Can anyone lead me in the right direction on what needs to be done to fix this. The database charset is 8859-1 I beleive, and my html pages are also 8859-1 and also render the data wrong, same "?"
View Replies !
View Related
How To Show Directory Of Forms On A Server
I need to have users be able to see a directory tree of some forms in specific folders on a server. The end-goal is to allow a forms admin to upload forms and have them immediately available for the user to open and download/print. The forms are mostly PDF but a few are XLS. Currently, I have manually uploaded the forms and kept a MySQL Database of forms names and their HTTP address - while this works, it is way too time-consuming to update forms and the DB. Is there a better way to do this with PHP (or any other method)?
View Replies !
View Related
Database Pull
im having a problem getting this syntax to work properly what i am trying to do is display the top 15 songs and when u scrollover the links of the song names that are pulled from the db it shows a title that displays there first and last name along with price pop and album name. all of these are in the same table except for firstName and lastName these are in the customer table. Code:
View Replies !
View Related
Pull Data Out Off Mysql
I am making a database using mysql where i have 2 tables, one for car manufacturers and one for car models.I've already done that. I have made a php page where i have 2 drop down menus. The first menu shows car makers(manufacturers) and the 2nd nothing. Now when a user opens the 1st menu and selects a maker , the 2nd automatically fills up with models from that car maker only and it gets its information from the database.That is every time i decide to add a new model to my database the 2nd menu (if selected) must go and search the database for all the models for that maker and show them. Code:
View Replies !
View Related
How Do You Pull All Data From A Field?
How do you pull all data froma field no matter what its result.. like this.. results.php?city=$city&type=ALL&zone=$zone so where type=all i want to get all restaurants in whatever $city in whatever $zone, meaning chinese, mexican, all rest listed in persay newyork zone 1 what is the wildcard to pull that..
View Replies !
View Related
CURL To Pull Data From A Site
I've been using php and cURL to pull data from a site, and things worked just fine. however, when i used the same script to access a different site, not data is being returned. however, i can go to the url of the site being used and there is clearly html there which should theoretically be scraped. any idea why it is not being gathered and how can i fix this?
View Replies !
View Related
Pull Data From A Second Sql Query Using A Where Clause
I am trying to pull data from a second sql query using a where clause = two fields from the first query. I am trying to gather from the second query, any data where we have a match from either of the two in the where clause. sql=my select 1,2 from t1 while $row { $one=$row[1]; $two=$row[2]; sql=select 1,2 from t2 WHERE 1 = '$one' or 2 = '$two' group by 1,2 while $row2 { //trying to output all rows that either 1 or 2 from t2 match 1 or 2 from t1. so all grouped results from 1 display all unique results in 2all grouped results from 2 dispaly all unique results in 1 where either 1 from t1 = 1 from t2 or 2 from t1= 2 from t2.
View Replies !
View Related
Resource Id #3 - Pull Out Data From My Table
I am trying to pull out data from my table. I know there are some records there, but when I tried the following code: $query = "SELECT * FROM logpage WHERE user = '$user_name'"; $result = mysql_query($query); echo "result is ", $result, "<br>"; I got "result is Resource id #3".
View Replies !
View Related
Script To Pull Data From SQL Table
I'm running a php-enabled dedicated server. All my sites on said server incorporate simple php scripts (includes, month/date, etc.) and that's the extent of my php knowledge. Some of my sites have SQL databases which I administer via phpmyadmin, but I've been unable to track down a simple php script to: * open the database * refer to a specific table * extract data from the table * display the data on a website Can anyone point me to an online doc or provide a simple script to follow which I can customize for my purposes?
View Replies !
View Related
Pull Data From A Table Using A While Loop
I noticed that when I pull data from a table using a while loop I am always missing the first entry in the set. To solve it for now I have placed a Dummy entry into the database, which works fine for simple lists but when the query begins to ask for any number of combinations of fields it seems like that is not a suitable fix.
View Replies !
View Related
How To Pull Only Unique Items From Database?
I have a table like this: date, author, title, content now I want to grab the 3 latest items from this table from 3 DIFFERENT authors. I want this: -article by jim -article by sally -article by john Not this: -article by jim -article by jim -article by sally even if the two latest articles happen to be by jim, lets only grab the first one and move on. So basically I need (in pseudo-sql/plaintext): select title from contenttable where author=unique order by date limit 3 I've got everything code-wise except the "author=unique" part, how do I do that?
View Replies !
View Related
Pull From Multiple Database Tables
In table one is a list of names, name_1, name_2, name_3, ... In the second table their are photos related to each name. Some names have multiple photos, some names have none. The correct photo for each name will be marked as "selected". So for example, SELECT photo_name FROM $table2 WHERE name = 'name_1' AND photo = 'selected' What I want to do is create a page listing 50 names and each name will have the selected picture next to it if it exists, but the only way I know how to approach this would be to run a query on table 1 once and 50 queries on table 2. $result = mysql_query( "SELECT name FROM $table1" ); while( $row = mysql_fetch_array( $result ) ) { $query = "SELECT photo_name FROM $table2 WHERE name = 'name_1' AND photo = 'selected'"; ... } This seems highly inneficient and I know their has to be a better way to approach this. Any help or links to a good tutorial.
View Replies !
View Related
Using A Loop To Pull Data From Mysql Recordset
This has set me back a couple of days now and I could really use some help or at least a shove in the right direction. What I'm trying to do is list reviews in a database on a page, by artist (byartist.php). The first step is pulling each artist and listing them alphabetically. If the artist has more than one album reviewed, they should still only show up once, so I need to check each row of the recordset, and check the artistname against a variable or something, and if it exists, to just skip it and move on to the next row. Then I need to list the albums reviewed under each respective artists name and use them as links with url parameters to the respective review pages. I've got the recordset down per some advice from another newsgroup, and I'm fairly certain its correct for what I need to do. <?php require_once('conntest.php'); ?> <?php mysql_select_db($database_test, $test); $query_byartist = "select artists.artistid, artists.artistname, areviews.albumid, areviews.atitle from artists join areviews on artists.artistid = areviews.artistid"; $byartist = mysql_query($query_byartist, $test) or die(mysql_error()); $row_byartist = mysql_fetch_assoc($byartist); $totalRows_byartist = mysql_num_rows($byartist); ?> The php example I was given for pulling the results was kind of half-effort and not enough for me to really see what was going on, understand it and build upon it. I'm (obviously) just starting out with php/mysql and I'm pretty good at building upon something in front of me and figuring it out, just need a little help because I've tried it over and over and to no avail, I wind up with syntax errors. Sorry for the wordy post, I didnt want to skimp. Thanks for any help or advice or any points in the right direction. I've got about 3 days of progress to catch up on
View Replies !
View Related
Using The Mysql_fetch_array Function To Pull Data In As An Array.
Im currently pulling in a load of data from my sql table. I found that using the mysql_fetch_array function was the way to pull it all in as an array. The only problem? I cant manage to get it to store a value into another name eg $ip = $row['ip'] and count how many instance's are contained within it. I need to do similar things to the 'url' and the 'time' but as I cant access the data there isnt much I can do!
View Replies !
View Related
How To Pull 1 Line Of Data From A File? NO MYSQL
I have this file that has 2 lines in it. Heres how the files looks. file: fbddata.lbn line1:uncle1234562 line2: As you can see, on line 2 there is actually no data but the file still seems to have a 2 lines. But when I pull the info from the file using the "include" or "require" command it just pulls the 1st line of data. BUT..when I try to use the "include" or "require" php commend within a HTML link code like this.... <a herf="www.mysite.com/Lavishphpfreak/<?php include("fbddata.lbn" ?>/ilovephp.php>LINK[/url] it gives me a link that this... http://www.mysite.com/Lavishphpfreak/uncle1234562 /ilovephp.php now did you notice the code that was added to the link. I have figured out that its doing this because of the blank line 2 thats in the fbddata.lbn im trying to pull the data from. Of course the easy way to fix this would be to just go into the file and delete the blank like 2 but i can't do this because i dont have permission to edit the file. Its created using "root". So does anyone know of a php code that will just pull the 1st line of data from within a file. I can't use mysql cause this is NOT in a database..and plus I haven't advanced to databases yet.
View Replies !
View Related
Mysql_Fetch_array(); Pull An Array Of Data From Mysql
im trying to pull an array of data from mysql. this is the code im using. PHP Code: //the sql syntax below pulls the last 7 records from the database $sql     =    "SELECT * FROM db_news ORDER BY 'id' DESC LIMIT 7"; $query    =    mysql_query($sql) or die('MYSQL QUERY ERROR' . mysql_error()); while($row = mysql_fetch_array($query)) { echo $row['id']; } the code above outputs 'id's' 7 to 1 as 7654321. what i want to do is explode the 7654321 into an array so i can call them any where on the page. and not just while the while loop is running, complicated ? what im trying to do is grab the latest 7 news reports from mysql and then display them in certain places on a webpage.
View Replies !
View Related
Mysql_fetch_array Way To Pull Out All The Data, Store It In An Array
I have a webpage which runs repetitive queries agaist a database in order to extract one item at a time and then put the items in an HTML table. The reason for this is formatting, plus the page hits 4 databases. Instead of running multiple queries pulling one item at a time...is there a way to pull out all the data, store it in an array, and then pull individual items from the array with php as I want to insert them in the table? So, example is Code:
View Replies !
View Related
Pull Data From Mysql Db And Break This Into An Array
I am trying to pull data from mysql db and break this into an array that I can then pull certain bits of data from, hope this makes sence to someone. PHP Code: $dbh=mysql_connect("localhost", "$username", "$code") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("$database"); $query = mysql_query("SELECT * FROM `allflights` WHERE id='$callsign' ORDER BY date DESC LIMIT 5") or die (mysql_error()); I would like to place like data for say these five items so I can have them stored in arrays and then select the different data as needed from each one.
View Replies !
View Related
SESSIONS - Pull Information From The Db Solely Based On The Userid Field In The Database.
i have a user management system which i want to pull information from the db solely based on the userid field in the database. When the user logs in a session is created which looks as follows: PHP Code: session_register('userid'); $_SESSION['userid'] = $userid; session_register('first_name'); $_SESSION['first_name'] = $first_name; session_register('last_name'); $_SESSION['last_name'] = $last_name; what would be the code to pull the content from the db? i'm thinking it would be something like the following, but i'm not sure as this is the first time i have ever used sessions. PHP Code: if($_SESSION['userid'] == $userid;{ $query = "SELECT * FROM `users"; $result = mysql_query($query); $rows = mysql_num_rows($result); ...............
View Replies !
View Related
Getting Images To Show Up From Database
I am trying to include images on a product page for a site and an email link on each product with the name of the product in the subject line. I have a sperate folder with the images (called products) and within product there is a folder called thumbnails- the image path would look like this: products/thumbnails/image1.jpg I am getting an area for the image but no image. As for the link- how do I put a subject line into the email in the php code? Can I do this? Code:
View Replies !
View Related
Don't Show Results From Database If ID Is...
I know I have to use regex for this but I'm a complete noob at regex and I must have it ready by tomorrow! So any help will be greatly appreciated. What I would like is that if the script finds an ID with dots in it, followed by a character or a number (like this Κ600.33.029.01) it won't show at the results page.
View Replies !
View Related
Show Last 5 Database Entries
I just set up a database with tutorials (id, title, description, image, url, cat) id is auto_increment, so the highest id should always be the last tutorial. I want to show the last 5 tutorials on a page, so I tried to use this: PHP Code: <?php include("connect.php"); $sql=mysql_query("SELECT * FROM tutorials ORDER BY id DESC LIMIT 0,5") or die(mysql_error()); $x=0; while($row=mysql_fetch_row($sql)) { echo ($x+1).') '.$row[title].'<br />' $x++; } ?> But I got this output: 1) 2) 3) 4) 5)
View Replies !
View Related
Show All Records From Database
How to show all records from database. (i mean row by row).for my code, i can only show the last record. $query = "SELECT * FROM tblpatient"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); while ($row = mysql_fetch_assoc($result)){ echo $row['Name']; echo '<br/>' echo $row['Address']; }
View Replies !
View Related
Show Data From Excel File
My clients want to upload some excel file and want to view data in their site from those excel files. They may update the excel files regularly and the content of the dynamic page should be changed according to the excel files. Is there any way to connect excel files using php? I'm planning to store the data of excel files into mysql database when they upload the files from browser's interface.
View Replies !
View Related
Show A Field Data(text)
How can i show a field data(text) when i move mouse over a pic (like alt text of pic) for example your credit pic is available in a page,now u move your mouse over the credit pic and it shows your credit (like alt text in a simple image)from the My Sql. (for example: field name in sql is is: kom ) any thing like this : <img src="pic/me.gif" alt=" this section code is nedded " width="9" height="9"> <img src="pic/me.gif" alt=" $read from kom " width="9" height="9">
View Replies !
View Related
Extract Links From Database To Show
In short words. I want to extract links stored in a database to show them on a page. Instead of showing the link itself a text saying "Click here to show" should appear and if clicking on THAT link a new window with the correct site will open. Can this be done? Currently using this code: <? $db = @mysql_connect("localhost","root",""); $databasen = mysql_select_db("linklist"); $fraga = "SELECT * FROM links"; $resultat = mysql_query($fraga); ?> <html> <table border="0" cellspacing="2" cellpadding="5"> <tr> <th>Title</th> <th>Link</th>........................
View Replies !
View Related
Question On Having A Link Show Up In My Database
I have created a Database that will list a list of items I have on a character from a Video Game. And I used a program called PHP Generator to generate a PHP Page that pulls this Database info and displays it in a site. That can be viewed here <snip> Now my issue, is as you can see for the Link Column. I am trying to make that be just the word link and click able to open the link in either the same or new window.
View Replies !
View Related
PHP Data Transfer In Forms
basically I am looking for a way to transfer form data into php variables. Most of them are not a problem but I can not figure out how to transfer select values or radio button values. Can anyone help? I will be posting the code for the page I am working on after I get home from work.
View Replies !
View Related
Preserve Data In Forms
I have a simple HTML page where I have to fill out a form. (Radio buttons, input text, textarea, etc.) When the user hits "Submit", a new page is called where I check for the required data from the form. If anything that's required is missing, the user is redirected to the HTML page with the form. The problem is that whatever partial data was entered previously, now it is gone. Is there a way to ease the user's mind from retyping everything rather than entering only the missing part(s)?
View Replies !
View Related
Pulling Data Out Of Web Forms
My company has charged me with the task of creating a web site that will allow contractors to "copy" and "paste" data into a web form and then submit the data to us. The contractors will be copying data off of another web site and then pasting the data into a web form that I have created for them. Is there a way in PHP to have a phone number extracted out of the pasted data and populated into it's own field in the database when the form is submitted? The format of the phone number will be (xxx)xxx-xxxx . My goal is to have a table with a phone number and details (the pasted data). Would it also be possible to have the first name, last name, and phone number all automatically picked out of the text area on submission? There are two instances of both first and last name. We would want to only pull the first instance of first name and last name.
View Replies !
View Related
Passing Data With Forms
I have a form that is supposed to pass the data to a page to be processed and entered into mysql... I keep getting this: Data inserted successfully.INSERT INTO license (quantity, lic_num, sw_id, purch_date, exp_date, po_num, auth_num, notes) VALUES ('','','','','','','','') but there is data in the form when it is submitted. Register globals is off and I prefer to leave it like that Code:
View Replies !
View Related
Forms Not Posting Data
I have a problem with one of my servers.. the forms dont post the data in a normal form.. One server it works fine, the other it doesnt.. eg. Try these forms (ignore the content, and it wont get sent anywhere).. on the first one it will post and display your details after you submit the form, but on the second hosting it doesnt Code:
View Replies !
View Related
|