Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Editing ID Field In Database.


I have come across a problem with some coding work that i am doing. My problem is the following: Presenters in the radio station, are shown in order of ID.

What i want to be able to do, is edit the order in which they are shown, by editing the ID. My problem, is that when i process the form the script has no way of telling what the field names are, as they are not pre defined, because i have put the code in a while loop, to get all of the DJ's names & id's out. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Editing MySQL Database
I've got website running happily using XAMPP 1.4.15

However, I desperately want to upgrade to the latest XAMP 1.6.1

The problem I'm having after the upgrade is with a php page that lets me edit users. I can add users ok but if I try to edit them, all the cells in that row end up empty. There's no error message which makes it difficult to diagnose.

At first, I thought the reason was due to the new XAMPP having MySQL 5.0.37. I upgraded XAMPP 1.4.15 to MySQL 5.0.37 and it still worked perfectly. There's something in XAMP 1.6.1 which isn't compatible with my php code. I even tried  XAMP 1.6.1 with PHP 4.4.6 but I still had the same problem.

Editing Mysql Database Row With Select Box
I have a small site, this small site has a few categories, now I can add items through my online admin area fine and delete them fine, but when it comes to editting them I am having some trouble, everything is working fine except the category column, because it is a drop down box I do not know how to have the category selected during the creation progress selected all the other info is loaded.

Large Gap When Editing Text From Database
My first PHP project is a very simple blog system and I have a page which lists blog entries. This page provides a link to the edit page, when clicked opens the edit page and inserts the values from the database into the from. My problem is that it puts in a large gap of two tabs and two spaces the start of the from. The challenging thing is that if I slick submit, the gap is not put into the post.

Modifying Database Using Primary Key Field?
Is there a problem with using the primary key as a definition of what to delete? I am using the following script: PHP Code:

Counting Field And Update Database
I was trying hard to alter an existing script ut I didn't succeed to... 

I have 2 databases:
- Categories (catid, shortname, description)
- Transactions (date, amount, balance, user)

in the categories I have 9 categories.

the script displays the categories as checkboxes to choose from. I want to add the following functionality:

If I select for example 3 categories, I would like to know how can I count the selected checkboxes and based on the count update the transactions database:

in another way:

if count=3 => add amount  x 3 to the transactions database so if a user select 4 categories I update the transaction database with $5 x 4 categories and then we will get a balance of $20 for the choosen categories.

Searching Part Of A Database Field?
What i have is a massive log file and ive tried extracting using Excel, Word etc but it doesnt work effectively.

say in one database field i have:

/index.php menu_id=1116 80 - 194.152.95.202 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322) 200 0 0 14775 526

I then need to extract and return just the menu_id=x and return x in a variable, any ideas how to go about this?

Assign Variable From Database Field
Is there a way to assign a variable from a database field? I'm thinking along the lines of

$make = $row_rsList['make'];
$model = $row_rsList['model'];

then they'll switch out based on my SQL WHERE statement. This valid syntax?

Displaying Information From A Database In A Text Field,
I am trying to create an admin page, but before I get anywhere near that, I need to understand how to get data froma database to show up in appropriate form fields *text, textarea, etc...*

I am able to get content from my database to show up in my template, now I want to create a page that allows a user to click on a link for which they want to edit the information (name, and bio) So I want that page to show up with a simple form, a text field displaying the name, and a textarea displaying the bio information, so that they can modify it and save it to the database. how do you get the information to show up in the form fields? Code:

Session Variables To Store Database Field
On my site I allow users to log in. If the login is sussessful they are taken to a page saying welcome and their name is pulled from the database and displayed on screen. What I want to do is be able to store their name pulled from the database in a session variable if possible which I can then show there name on each page. Is this possible, im using MX to do so.

Inserting A Complete Array In A Database Field
I have a very big signup form and it is almost impossible to create a full table for it because of very high number of form fields and I dont want to create a field for each of them in my database's table.

but I managed to store all the form values in an array, is there a way to fully insert an array to just one field? and for future use select it again as an array?

Putting An Array In A Mysql Database Table Field
I want to insert an array into my database but i've got a problem with it.

Before i insert the array into the dbase i check if everything is in the array with print_r($array). Everything that should be in the array is in there so i insert it into the dbase.

When i check my dbase with phpmyadmin the field that should contain my array has the word array in it so i assume the array is in the dbase. But when i retrieve the data from my dbase and check my array with print_r i get the following error: Warning: Argument to array_values() should be an array in.

Check What Type (integer, String Etc) A Database Field Is
If i have a datebase field like so:

$username = $row['username']; //after SELECT and mysql_query etc.

how do i check what file type it is? i have tried using is_string to
check it but it returns all fields back as strings, even the ones i
know are integers. i would like something that would tell me the data
tyle (integer, varchar, text etc). are there any other ways or am i
doing this wrong?

WordPress Database Error: [Field 'pinged' Doesn't Have A Default Value]
Now a days, I can't post anything in my blog. it shows the following
msg,

WordPress database error: [Field 'pinged' doesn't have a default value]...

Single Quotes In Database Field Breaks Form?
<?php echo "<input type=text name='storename' value='$storename'>"; ?>

I noticed that if $storename contains something like "Ma's Bakery", all
that shows up in the field is "Ma". Do I really have to go through all my
form fields and change them to
<?php echo "<input type=text name='storename' value='".$storename."'>"; ?>

Although I guess
<?php echo "<input type=text name='storename' value="$storename">"; ?>
would work, too.

Limit A Database Field To Displaying Only One Time And Still Display All?
I have a data table with a field that contains the exact same text (example "some text") on several different rows. How can I display all my rows without getting duplicates of this field; I only want to display this field once. I tried to use a LIMIT, but this is not what I needed. Code:

How To Retrieve An Xml File From An Xml Field Found In Mysql Database?
Infact i have a mysql database in which i have field name xml in which all the metadata are stored in xml files.

Converting Value Of 'email_id ' (varchar Field) In Mysql Database To Ascii Code
I want to use value of 'email_id' (varchar field) in mysql database to covert into respective ascii code so that it can be used for future purpose.a part of my code is given below.can someoone guide me how to do that as I am new to PHP.I ma using PHP5.2 with mysql 5.0 nd IIS 6.0. Code:

Can A Field Communicate To A Server And Return Information To Another Field Without Retrieving The Whole Html Code Again?
I´ve got a sql table which has 3 fields.
Their relation to each other is like this example.

| CARS | YEAR | PRICE |
ford 2000
ford 2001
ford 2003
volkswagen 1999
volkswagen 2000

I am developing an ASP web page that modifies a specific registry.
So, it loads the information to some fields, but the user will be able
to change only the "PRICE" field.
I have to create two selects, one for "CARS" and other for "YEAR".
But the "YEAR" field will only contain the correspondent years for each
car the user selects. Example: selecting "ford" in the "CARS" <select>
box, only the years "2000", "2001", "2003" would be automatically
loaded in the "YEAR" <selec> box.
How could i implement it?

How To Update A Table's Field With Another Tables Field?
I need to take the state field from dt_profile table and update the dt_matchfinder with this state making sure the member_id field matches.

the problem is the dt_matchfinder table has null set for many of the state field but in the dt_profile each member ID has a specific state and I need the same to be true in the dt_matchfinder table.

INI File Editing...
Does anybody know how to open up an ini file and edit one section?

like find the section called [votes] and just replace the values underneath it, in that section alone?

vote.ini
[votes]
a=7
b=2
c=55
d=0

find that section, replace the values with there new numbers, without having to deal with what sections come before and after this, in the ini file?

Editing A String To Add A Before A '
Is there a function that allows you to add a before a ' in a string.
This is needed to store text in a mysql db and i was wondering if there
is function which can do this to any ' which DO NOT already have one
before them, this is so i can keep editing my text without all these
building up.

Editing HTML/
I'm looking for a way to editing my site on the fly (unfortunately I don't have DB support). I've been messing around with file functions, and that part seems to work fine.

My problem is that backslashes are being added when I post the form I use to edit the files, and if I understand it correctly, I can't just use stripslashes() since there are some backslashes I need to get through (like)Any solution to this?

Editing Rights
Is there any way to allow a PHP script editing rights to every file on its filesystem?

Php.ini File Editing
I need your knowledge,

I want to add to my website php.ini file to change the settings of my
mail() function so that my function is working fine except that the
sender email is not my user but nobody@hostingprovider.com so Someone
told me that its easily edited using php.ini but he dont know how, so
I thought that you could help me in this situation.

more details about my hosting:
- Linux host
- php 4.4.6
- apache

Editing .htaccess
Is there a way to edit a file (in this case .htaccess) in PHP to add a line of code?
EX. What I want to do is add this line to .htaccess: DirectoryIndex main.php?id=5

Editing A Table
is it possible to print a table and then that the user can edit it? My site is for an institute so in a colum will appear all the names of the students and I want that they can give all the notes next to their names, so I was thinking in do it with a table but i dont know if it is possible to edit the table: Code:

Help On Editing PHPBB
I do manage a website and it includes a PHPBB forum, obviously placed at /forum (¿why to use a weirder path? :P). The thing is that my site is more than a forum, it has more content. I have menus almost everywhere, it's very navigable; but if you go into the forum, you can only get back to the other sections of the site using the back buton or removing everything starting from /forum in the address bar. Of course, this doesn't fit my site's philisophy, which is almost to put menus even inside the menus in every page, so you can go from everywhere to everywhere... I hope you cacth it. I've noticed that it shows the domain and title I put in the admin panel. Well, what I'd like to do is to make this text link to my homepage, placed at /index.php or simply /. The problem is that I'm completely lost when trying to do something in PHPBB's source files. I don't know which file should I edit, nor where should I add the code. These files are a code labirynth for me, and I need to edit them to fit my site's needs.

Looking For A PHP App For Editing Pages
Any ideas?  Basically something that would allow me to upload/copy/delete/edit webfiles.  It would probably use a WYSIWYG javascript editor.  Not really looking for a CMS because they don't work with existing html files.

Form Editing
I am trying to call information from a MySQL database in for form of an editable form.  I want the info to be called into a box that can by typed in and so far that works. 

What I want to do next is to be able to change what is in those boxes and click an update button which updates what was called from the database to what I typed in the box.  The code I wrote is below and almost works. I'm not sure what the problem is. Code:

Editing An Xml File
I have an xml file that I use to store information in. I want to be able to add info to it without deleting whats in the file.

Drop Down Box Editing
I have 3 linked drop down boxes ( Eg: Country, State and City ) .  I've  set values for the drop down boxes initially and  I would like to edit the values later. Is it possible to show/highlighte the set values ( the value I've put earlier ) while editing the drop down boxes using  PHP or AJAX.

Editing A Table
i've checked my code like a thousand times and it seems to me there're no syntax errors in it, but I still don't manage to get the damn thing working. It's a script to update an event stored in a db, you can edit both the description as the date of the event. Code:

Editing A Row In A Table
I'm having trouble editing a row. The existing data echoed into the form ok but if I try to change anything and click submit, the error message at the end of the script is echoed. Code:

Editing Data
What i want to do is edit details that have been taken from mysql database and display them in a text box.

I'm under standing what I’ve done so far which was to bring the job id code of the job that i want to edit from another page and i no the code to edit but what i can’t do is display the job data into a text box so it can be seen and edits can be made. All the books and website and forms I’ve read don’t show how to display the data to a text box or it’s so complicated that i don’t have a clue what’s going on? Code:

Select Both Field Name And Field Value- Mysql ?
What function to use to select both field name and field value from a mysql table ?

Editing System Passwords With Php
I need to create a php script that adds new users to my FreeBSD server. I've tried running the 'pw adduser' command through a script, but I can't pass a desired password to it.

I've also tried using the pw command with a password encoded in md5, but I'm still pretty confused about how the encryption works.

Editing The Win32 Registry
Does anyone know if the equivalent of PERL's Win32::Registry module exists for PHP anywhere? If so, I'd be grateful for a push in the right direction.

Editing An Element Within An Array
I have a two-dimensional array that looks like this:
array(
array(0, 123),
array(0, 234),
array(0, 345),
array(0, 456)
)
I want to REMOVE any element that contains 234, and I want to
INCREMENT the first value for any element that contains 345, to make
it look like this:
array(
array(0, 123),...

Editing Info In A File
I am using a tab delimited file to provide information for a page to be displayed. I have used fgetcsv() to get information from the file, and it returns an array of information. I was wondering if there is a way I could change information in the file. For example lets say that $content[2] = "This" how could I change it so that, $content[2] = "That". I know how to change the variable to a different value, but I haven't figured out how to change the actual file.

Editing One Line Of A File.
MySQL ahs been giving me tremendous problems ever since I tried to switch to version 5.0.20. I thought that I might make my own SQL program, out of PHP code.

But if a user of it has a table with hundreds or more entrys, editing one line would take hours. If you can't get PHP to edit one line with a few functions, what about splitting a file into three parts and then merging them together after editing the middle part, like so: Code:

Editing Files In A &lt;textarea&gt;
I've written this program to let me edit ASCII files on my server in a <textarea>. However, if the file that is being edited contains a textarea within it, then I get problems.

what I want to do is read this file into the textarea but I want to convert all of the < and > characters to &lt; and &gt; 's. I figgered you'd do this through Regular Expressions: however these are poorly documented in the PHP book I have, though the Perl book I have tells me how to do this. Could someone tell me how to do this, IN PHP! Code:

Editing Mysql Db Using A Php Form
I am working on a Sig Request database. People submit their request using a form and it's posted into a databse and then displayed beneath the request form. This is working fine. I am having trouble however with my edit.php file.

I want to be able to load a users information, which I have done using this code below. It displays in a form. I change 1 or 2 of the fields, such as the completed field and designer field and click update but it doesn't actually update the database.

The page first lists all the requests. It lists their ID, Name and then it says "Edit this Request" which opens a page with their sig request details in. Here is my code below for the edit.php file. Code:

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

Editing HTML In A Form?
I want to build a very basic online text editor, to allow customers to
modify their own sites' html content using a simple form with textarea
element.

I read the HTML file like so:

<?PHP

function EditText ($filepath)
{
if (!$file = file($filepath)) return false;
foreach ($file as $line) {
$value .= $line; // contains all text in file when done
}
$html = "<html><head><title>Editor</title></head>
<body>
<form method='post' action='processtext.php'>
<textarea rows=&#3940;' cols=&#3980;' name='txt' value='$value'>
<input type='submit'>
</form>
</body>
</html>";
echo $html;
return true;
}

EditText ('/sample/index.html');
?>

The problem comes when the parsed file containing html elements itself
is echoed to the browser. In itself, PHP does what it's asked, but all
browsers I tried choke on the contents of the TEXTAREA field. Best
example may be: try parsing the file containing the script itself, it
becomes a real mess.

I tried htmlspecialchars, this did not fix it. I tried addslashes to
only escape the quotes in the parsed file, also no success.

I saw one example online where 'they' preg_replaced about every possible
(x)html and php syntax element, resulting in an immensely large and slow
script. Can't imagine that's the proper way forward.

If at all possible I'd like to stay away from Javascript. Any idea if
this is a realistic approach? Are there any useable scripts available? I
searched google a lot, but I keep ending up at sites that offer html or
php editors for local use, not in a browser.

Editing A (config) File
I have a file with some configation in it... I am wondering how I
correct single values in there.

The most secure is to recreate the file, then rename it.

But is there a way to correct a line in the text file?
setting1=bla -setting1=blablabla

Needless to say, there are things in there I'd like to keep at all
times.

Editing A Line In A File
I have a php file, I need to open it, find the line that reads "$pass[0]  = "fa03eb688ad8aa1db593d33dabd89bad";" and edit the value
"fa03eb688ad8aa1db593d33dabd89bad". How can I do that, I have

   #Open the file
   $ourFileName = "access.php";
   $fh = fopen($ourFileName, 'r+') or die("Can't open file");
   fclose($fh);

Editing And Updating Text
I'm trying to create a text editing and updating capability to help
someone who wants to maintain content on a web page without having to
know any HTML or use a web authoring tool and FTP'ng the contents.
I've already created a screen whereby the person can create new
content with a PHP program that inserts into a MySQL table. But, I'm
having a little trouble in creating the edit/update functionality.

I created an edit screen called "teach_edit.php". Based upon some
search parameters on another HTML screen, it retrieves the appropriate
text from the database. It seems to allow on screen editing.
However, when I hit the Submit button, nothing happens. It's supposed
to call another program called "teach_update.php". Here's the code
for it.

<HTML>
<HEAD>
<TITLE>Teaching Edit Program</TITLE>
</HEAD>
<BODY>
<?php

@ $db = mysql_connect('localhost', '<db name>', '<password>');
if (!$db)
{
echo "Error: Could not connect to database. Please try again
later.";
exit;
}
mysql_select_db("<db>");

$query = "select * from albert where ".$searchtype." like
'%".$searchterm."%'";

$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$title = $row['title'];
$teaching = $row['teaching'];
$teaching = wordwrap($teaching, 60, "
", 1);
$teachnum = $row['teachnum'];
}
if ($result)
{


Good PHP Editing Program
could someone suggest a good PHP editing program? I have been using GoLive - I'm sure there's something better out there.

Deletion And Editing Of Modules
i'm creating a miniature CMS. At the moment i'm working on the creation/deletion and editing of modules. I've got the creation working. But i'm struggling on the deletion and editing.

This is what i was thinking:

[Deletion]

1. (ID) Module 1 [Delete] (Link: modules.php?do=delete?name=Module%201&id=1)

[Editing]

1. (ID) Module 1 [Edit] (Link: modules.php?do=edit?name=Module%201&id=1)

How would i make it so the URL was that?


Copyright © 2005-08 www.BigResource.com, All rights reserved