Problems With The Listing Of Records, Editing Of Records
I'm having problems with the listing of records, editing of records, and deleting of records. I'm not sure what I'm doing wrong.
The listing script is calling the add entry script. So I add the record, the database is updated, and nothing else happens. I don't get a list of records from that table.
When I did SQL programming off the mainframe, you did a simple select statement. I'm not sure why the PHP list script is calling the add entry script. Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Listing Records As Well As Insert
I'm getting all the data from a row of a table into a list box. On selecting a record in the list box, the corresponding records has to be displayed in the second list box. And now, i have 2 text boxes where the user can enter some text and then can insert into the table. In brief, i have 3 tables:thema, unterthema, artikel: Thema(Thema_id, Thema_name) Unterthema(Unterthema_id, thema_id, unterthema_name) Artikel(artikel_id, unterthema_id, artikel_name, artikel_content) So, at first, i'm displaying the records from thema_name in a list box. Now, when the user selects the record, the second list box has to be filled with unterthema_name. Now, the user can enter some text and it will be inserted into the fields(artikel_name and artikel_content).
View Replies !
Editing Multiple Records....
Im trying to make it so that I can sort fo like edit all teh records in a table from one page, and im thinking have it like this: Field 1.........Field2......Field3.. Record1..................................Button to edit the info in this record Record2..................................Button to edit the info in this record Record3..................................Button to edit the info in this record Record4..................................Button to edit the info in this record
View Replies !
Editing Checkbox Records
Let say i have a form that asks user to select few options from a list of checkboxes, say if user want to edit the list he/she checks when submitting the form, how would i show the checkboxes in the editable form.
View Replies !
Table Row Records For Editing
I have a repeat region of a table called userid. What i¹m trying to accomplish is being able to edit the record and then update it by clicking a submit button on the same line. I¹m doing it this way so the user can quickly update a number of records one at a time. I know I could do this by passing the userid info to a detail page but really want to do it the way described.
View Replies !
A Data Repository Project Using A Flat File Needs Advice On Editing Records
I am a wannabe programmer and decided to attempt a small project in php that I could use for an organization that I am affiliated with. It is a repository for name, address, phone number, registration number, etc. About 20 fields in all. It will only be accessed by 3 or 4 users, and generally the information is fairly static so these users will for the most part only be searching the database and displaying some specific reports (probably in table form).. Code:
View Replies !
Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page. I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields. If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:
View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:
View Replies !
DNS Records
Hey everyone, I'm trying to get a DNS record of an IP using PHP's checkdnsrr() and getmxrr(). I used echo checkdnsrr($REMOTE_ADDR); and echo getmxrr($REMOTE_ADDR); but I receive an error that the PHP build does not support it, but I am using PHP 4.0.5 and in the manual, it shows that PHP 3 and 4 supports the two commands. Any help?
View Replies !
Next N Records
how do I create a "next n records" interface? I want to initially output a specific number of rows, and have a next/previous scenario where the user can click on either and scroll forward or back through the records. I'm currently outputting all rows through mysql_fetch_array: Code:
View Replies !
HOW TO GET HOW MANY RECORDS YOU HAVE IN DB
I finally discover the way how to get what I need. Let's look to my code: ----------------------- CODE ------------------------> $res = @mysql_query("SELECT COUNT(*) AS ToT FROM table_name"); $dato = mysql_fetch_array($res); echo($dato[ToT]); ----------------------- CODE ------------------------> With this code you will get how much records do you have in DB. PS: Whan you think that everything is over and that you are at bottom of trying push harder to see what is under.
View Replies !
Old Records
Would anybody know where i have gone wrong in this script? $tm7781=date ("d:m:Y H:i:s", mktime (date("H"),date("i"),date("s"),date("m"),date("d")-1,date("Y"))); mysql_query("DELETE FROM tracker WHERE endsession < '$tm7781'");
View Replies !
3 Records Across
I have asked on this forum, but I need to know of a way to query a DB, and print the records across the screen 3 at a time. I always print downwards, but I am being asked to print 3 records, then break, 3 records then break, I am not sure how to do this.
View Replies !
Only 25 Records For Each ID
Is it possible to only collect 25 records for each ID? When I insert the 26'th record for that ID I want to get rid of the oldest record for that ID? I did it once in ASP and it looked like this: Code: strSQL = "SELECT * FROM list WHERE ID=1" rs.open strSQL, conn, 1 , 1 If rs.recordcount > 24 Then strSQL = "DELETE * FROM list WHERE Date IN(SELECT TOP 1 Date FROM list ORDER BY Date)" conn.Execute (strSQL) End If strSQL = "INSERT INTO list ( ID, Point, Name ) VALUES (" & _ "'" & sqllize(Request("player1ID")) & "', '" & sqllize(Request("player1Point")) & "', '" & _ sqllize(Request("Player1Name")) & "')" conn.Execute (strSQL) rs.Close Is this possible in PHP, and if yes, how?
View Replies !
Next Records In Db
i have, what i suspect, is a fairly basic task to perform, it's just i'm not sure how to approach it – client side or server-side? i load in an image (filename) from the db dynamically along with an image caption. my code is outlined below:  <!-- begin content -->  <div class="content">   <div class="gallery_image"><img src="images/gallery/music_sized/<?php echo $row_gallery_musicGetRecords['image']; ?>" alt="<?php echo $row_gallery_musicGetRecords['image_alt_text']; ?>" /></div>   <div class="caption">    <p><?php echo $row_gallery_musicGetRecords['caption']; ?></p>   </div>  </div>  <!-- end content --> my header code, accessing the db 'n what not is below: <?php require_once('Connections/emmadalzell.php'); ?> .......
View Replies !
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56. I have been using: mysql_num_rows What should I be using?
View Replies !
What To Do If There Are No Records In The Database
I am pulling data from the database and displaying it using the code below: $db = mysql_connect("localhost", "root"); mysql_select_db("pyramid",$db); $result = mysql_query("SELECT * FROM table where area='Wales'",$db); while ($myrow = mysql_fetch_row($result)) { echo "blah blah"; } ?> What do I do if there are no records? At the moment it just doesn't display anything. How do I get it to display a message saying there are no records?
View Replies !
Updating Records
I am know to PHP i've been tring to do this **** for days now could someone PLEASE help me. Ok Im tring make an admin page where user can update multiple records at same time using checkboxes.Im using email as primary key. Here is the code **form page** <form action="update.php" method="post"> <input type="submit" name="submit" value="Select First 10 Names"> </form> **update.php** <?php if ($submit =="Select First 10 Names") { ?> <form method="post" action="<?php echo $PHP_SELF; ?>"> <hr size=3> <?php $query = mysql_query("select * from Names order by Last_Name limit 10"); while($row = mysql_fetch_array($query)) { $first_name= $row["First_Name"]; $middle_name = $row["Middle_Name"]; $last_name = $row["Last_Name"]; $email = $row["Email"]; $photo=$row["Photo"]; ?> <table width="100%" border="0" > <tr> <td align=right width=50%> <?php echo "First Name: <input type=text name="first_name" size="30" maxlength="40"value="$first_name" ><br> "; echo "Middle Name: <input type=text name="middle_name" size="30" maxlength="40" value="$middle_name"><br> "; echo "Last Name: <input type=text name="last_name" size="30" maxlength="40" value="$last_name"><br><br> "; echo "Email: <input type=text name="email" size="30" maxlength="40" value="$email" readonly><br><br> "; echo "Photo: <input type=text name="photo" size="30" maxlength="70" value="$photo"><br><br> "; echo "<input type="checkbox" name="email[]" value="$email"><b>Update?</b> "; ?> </td> <td align=right width=50%> <?php echo "$photo"; ?> </td> </tr> </table> <hr size=3><br> <?php } ?> <input type=submit name=submit value="Update Enteries"> <input type=reset> </form> <?php } if ($submit=="Update Enteries") { if (is_array($email)) { while (list($key,$value) = each($email)) { $query= mysql_query ("update Names set First_Name = '$first_name' Middle_Name= '$middle_name' Last_Name='$last_name' where Email='$value'"); } } } ?>
View Replies !
Need Help With Deleting Records
I'm trying to add a link on the display of a record to delete that record. The main part of the record is stored in pw_event, then there are several rating fields for that record stored in pw_rate, and there is also several records for the first record stored in pw_whois. I need to have a link that will deleted everything for that record in all three tables. Here is my display script: PHP Code:
View Replies !
Retrieving Records With Between
I am trying to convert my asp website to php. So far so good, but I am having a problem with my SQL Statement that needs to us the Between. Here is what I am using: $sql = "Select * From tblTrack Where DateEntered Between $start and $end"; the vars start and end come from the same form. I don't have a problem when I hard code the dates, but when I use the variables, it won't retrieve anything.
View Replies !
PHP/MySQL Records Per Row
Is there any way to have the records pulled from a mysql database display like this in a table: record1 | record2 record3 | record4 etc: I've been thinking about this for about three months and have yet to come to a good solution.
View Replies !
Inserting Records
I'm trying to insert as many as records as possible but less than 100 into a table. First, i get the count inorder how many to add and then depending on the count, i get so many blank form fields to enter. Now, I noticed something really strange. 1.Only the last entered record is inserted into the table. 2.For example, when I type a name, Let us assume "WORLD", only w is inserted into the table and the rest is not.It is the same with all the form fields.whether, i'm trying to enter text or a number,only the first character is inserted.This sounds weird. Could somebody pls tell me why is this peculiar behaviour Here is the code:
View Replies !
Displaying Some Records Once Only
I'm building a database via mysql/php which brings back records of events. My problem is that I only want to show the Venue for the event once and then list the events for that venue. ie Code:
View Replies !
How Do You Sort Records?
I have a db table "person" that I can sort by title, first_name, last_name, or city with no problems at all because "title", "first_name", "last_name", and "city" are columns in the table. The requirement is to ALSO sort by department NAME. Problem is, I can't do that in the "person" table because the column is "department_id" which is a foreign key constraint to the department table. How do I sort the person records by department_name based on this? I am using PHP 4.3.2 and MySQL 4.0.10 Now, second problem and even more of a problem: The requirement is to ALSO sort by state NAME and country NAME. The fields "state" and "country" in the "person" table contain only an abbreviation of state and country; the corresponding full name of each state and country are found in respective XML files in /xml/state.xml and /xml/country.xml
View Replies !
Compare Records
is it possible to write a query to compare records in 2 tables, like if the number of records in the 2 tables are equal the query should return 1 if not equal the query should return 0. this can also be done in php like, get the number of records from one table and get number of records in another table, compare it and do the operation. but i wanted to know if its possible to do the compare records using the query itself. for example, if one table has 5 records, this should be compared with another table, if this table has 5 records, then the result of the query should be 1 else 0. if i use joints, it will return all the 5 records. so not sure how to make this in a query. anyone have any idea ?
View Replies !
Display Records
I want it to display all the records meeting the criteria specified in the script, but it only shows one records and should show about ten. any thoughts or pointers to get it to display more than one record. Code:
View Replies !
DESC Records
i want to make all the records be shown in a decending order, i've tried using: $sql = 'SELECT * FROM `repair` ORDER BY `repair` . `id` DESC';
View Replies !
Records Won't Delete
mysql_query("DELETE FROM guestbook WHERE id = '$recnum'"); It works fine on my local server but it doesn't delete records on the remote server. any ideas?
View Replies !
Count Records
How can I count how many records are in a table that match a news_id? I have this at the moment, but it doesn't seem to work. Code:
View Replies !
Retreiving All Records From Sql Db
IM trying to get cost values out of the db with a specific ID which is assigned to an item ID but i only get the last record in the database. $lala = mysql_query("SELECT `cost` FROM `table` WHERE `ID` = '1'"); while ($la = mysql_fetch_row($lala)){ $start = 0; $overall = $start+=$la[0]; } echo("$overall"); ...
View Replies !
Return Last 3 Records
I want to return the last 3 records added to my table called towns. sql = "select * from towns limit 3" This only returns the first three rows, I want the last 3. My primary key field is townID.
View Replies !
Getting ALL My Records To Display
In this code, almost everything is working perfectly, but for my second query, I have six records that I want displayed in their own table like I have. I know that a loop would probably work, but I am just really not sure how to go about this. I would like the code to display a table of each of the records. Code:
View Replies !
Can Session Id Be Same For 2 Records ?
can i confidently believe that a session id will be unique for all the users even if there are lakhs of users ? is there any possiblility that the session id can be same for 2 records ?.. i want to send an email to the user to verify their account after their registration. so i am sending the session id in the get and once they click that link it will take to a page where it will compare the session id with the one that is stored in the database.. is this the correct way?
View Replies !
Deleteing From Records
Ive created a mailing list using php3, and i'm trying to make an unsubscribe, so far i have it set up to mail me with the email of the person(s) wishing to unsubscribe, and i have to do it manually. Code:
View Replies !
Selecting Records
i need some code that will select all the records in between two dates based on someone entering in these two dates. problem is i have no idea how to code it as i dont fully understand the coding behind it. here is the code <form name="getdates" method="post" action=""> From: <input name="date1" type="date"> To: <input type="date" name="date2"> <input type= "submit" name="datesbetween" value="Get Dates"> </form> <?php $date1 = date(d,m,Y); $date2 = date(d,m,Y); if ($called){ return false else return true $date = mysql_query ("SELECT * FROM calls WHERE calls.called "); }...
View Replies !
Multiple Records To One
I have a database which comprises of a routes system.. some basic fields like ID | Routenum | Departure | Destinations | Deptime | Arrtime | Comments However, I have multiple routes where the Departure and Destination are the same, only the times are different. How could I make it so that only one appears on the routes list, instead of having about 5 similar entries?
View Replies !
Priority Records
I have a system in place that allows users to set call status to several different states, 1. No Answer 2. Not Interested 3. Not Eligible 4. Interested to Confirm 5. Send a Leaflet 6. Please Call Later 7. Interested and Confirmed i also have a page that auto allocates leads when the user as run out of them. What i want to do i make it so that and time a request is sent to the db for more leads it, takes all callbacks as priority and brings them out for the user to call straight away, instead of them having to navigate to the correct area.
View Replies !
Fetch The Records
i have a mysql table.it has 2 fields . 1.register_number 2.registered_date values 333333----2007/08/21 245678----2007/06/30 123123----2007/09/20 123222----2007/09/21 125553----2007/09/22 i have select box on a page and it's option values from january-december. when i select the month from select box and press submit button,it should fetch those records that are registered in that particular month. i just need the sql query logic to fetch the records of that particular month.
View Replies !
Ordering Records
I have a table of carpet designs, with references like Chinese 1, Chinese 2, Chinese 3 etc. As these are text fields, they display in the order Chinese 1, Chinese 10, Chinese 11,... Chinese 2, etc. I need to have then as Chinese 1, Chinese 2, Chinese 3 etc. I was about to add in an extra field RefNo that would be an integer and just be the numeric part of the text ref, and would never be displayed but just be used to order the records. Which I presume will be fine, but just wondered if there was any way of doing it just with the existing field?
View Replies !
Finding Records
Need to setup a query that checks a certaid field for any value, what is the syntax for that? $query = ("SELECT * FROM `tbl_customers` WHERE `sales_rep` LIKE '%$any_value%'");
View Replies !
DELETE Records
I am going to write a php script to delete some records based on values supplies by the user. I was just wondering if the query is correct but there are no records to delete for example if this query was executed but there was no testId 7, would an error occur or would the query be performed but just not delete any records? PHP Code: $testId = 7; $q="$q="DELETEÂ Â FROM test WHERE testId = $testId"; mysql_query($q, $link_id)or die(mysql_error());
View Replies !
Show Records In Different DBs
I am trying to show how many records are in each db. I have generated a list of dbs using this: PHP Code: $result = mysql_query("SHOW tables", $db); while($row = mysql_fetch_row($result)){ Â Â Â Â echo $row[0]; } This works perfectly and I want to add the number of records in each db displayed next to the db name. And I would even like to add a field value if I can. I definitely need some direction on this. Code:
View Replies !
Multiple Records And DW
I have a table in mysql with this fields id equipo puntos PJ PG PE PP I need a php script that show all the records in a way I can update all the data via ony one form. I read the topics post about this tread but still can't figure it out.
View Replies !
Holds 8 Records
the the table this query relates to holds 8 records but my code is only displaying one , how do i get it to print all the records into the table ? <?php session_start() ; require('db_connect.inc'); $query = ("SELECT abs_value, ID, notes, datestamp FROM absence_mgt WHERE ID ='$vtc_login' AND abs_value='1' ORDER BY datestamp") or die (mysql_error); $run= mysql_query($query); while($late_qry = mysql_fetch_array($run)){ $notes = $late_qry['notes']; $datestamp = $late_qry['datestamp']; ...................
View Replies !
Select ALL Records Between $1,000 & $25,000
I have a field called "price" in one of my MySQL database tables. I want to select ALL records between $1,000 & $25,000 - How can I do this? Also, what format would the numbers have to be in for this to work? Are commas or money signs allowed?
View Replies !
Get Next And Previous Records
I'm building a photo album that shows a photo (called current) and two links for the previous and next photos. I use ID field to identify photos ($IDnumber = $current_photo, then $previous_photo_IDnumber = $IDnumber - 1 and $next_photo = $IDnumber + 1). If I have an ordered table (the IDnumbers are 1, 2, 3, 4, 5) everything is OK. But when I delete a photo, eg, photo number 3, my the IDnumbers will be (1,2,4,5), I get into trouble. For example, when I see the photo having the IDnumber 2, I can not get the link to the next photo, in that case, the photo having the IDnumber 4 because the IDnumber of the next photo is defined by $IDnumber + 1 equal to 3 but the photo with IDnumber 3 have been deleted off the table.
View Replies !
Paging Through Records
I have a PHP page that prints the results of a large database to the web page. I only want to show 10 records per page with dynamically generated pages with links top the next and previous 10 records. How do I do this in PHP and MySQL?
View Replies !
Show Everything Except For Records
I'm trying to display the content added to the database from the beginning of time until "yesterday" (or the day before). This is what I have so far and it returns a general error. $sql = "SELECT video.id, title, description_text, category_text, level_text, user_name, DATE_FORMAT(date, '%M %D, %Y') as date FROM video, registered_users WHERE video.user_id = registered_users.id, (TO_DAYS(NOW()) - TO_DAYS(DATE_FORMAT(created,'%M %D %Y'))) < 2, ORDER BY id DESC"; Is there a better way to do this?
View Replies !
Use Records In Grid
I'm creating a table 30 cells high, and the wide is determined by the length of 1 recordset, right now its about 6 cells wide so 180 cells in total. I have 2 tables: records: id, corr_vcell_id, corr_col_name, text columns: id, column_name How can I create the table with values inserted into certain cells? I'm using double for loops to create the cell with no problems, but I don't know how to grab sql values using for, only do while.
View Replies !
|