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


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Delete Column Contents


Is there a way, through PHP, to delete the contents of a column without deleting the actual column. I know I could do it by deleting the column and adding it again but just wondering if there's a more efficient way.




View Complete Forum Thread with Replies

Related Forum Messages:
Count A Specific Column And Print Out Contents
I use PHPMyAdmin and there i can browse, and count a specific column and print out contents of that column and also count how many rows with that value. This is what PHPMyAdmin gives as php code:

$sql = 'SELECT COUNT(*) AS `Rows` , `column` FROM `table` GROUP BY `column` ORDER BY `column`'

View Replies !
Delete Folder And Its Contents
is there any way of deleteing a folder and all of its contents using PHP?

View Replies !
Delete File Contents
Can someone post some code to show me how to delete a file from a folder please? I need to delete a file first, and then upload something in it's place. Maybe a bit of code to slide in what i have already would work? Code:

View Replies !
Delete Table Contents?
ive got a table thats too big to dump the records in myphpadmin, how can i dump all the fileds (i think there are 4 or 5) but keep the table and fileds intact to be used again?

View Replies !
How Do I Delete A Column? MyQL PHP
I have a database where i want to be able to replace an image file in a folder and the associated database entry.

I want to keep the rest of the data in the row. Here is the current FORM SUBMISSION CODE that I use to submit to the database.

*** I would like to be able to delete the image file and the column "file" and replace it using a form.

Currently I can look at the list and modify each music review but I cannot edit the 'file' field for the image - which is a FileField.

THE SUBMISSION SCRIPT...

View Replies !
Delete Row From Mysql Only Deletes The Contents?
mysql_query("DELETE FROM cart WHERE ItemId=$ItemId");

There is the code but the result in my databse is that the ID number changes
from, lets say, 77 to 78 with 78's contents being empty. Therefore when I
look at the results - the deleted ID77 is gone but now I have ID78 with no
content!

Does anyone know why and how do I make it stop?

View Replies !
Delete Entire Folder Contents
What is the best way of deleting an entire folders contents in php I looked at this, but not sure exactly how to implement. http://uk.php.net/manual/en/function.unlink.php

I dont want to get involved with something that could mash my system if I get it wrong.

View Replies !
Want To Delete The First Letter In A Column With 275 Records
table : product
column : code

in this column i have 279 records with bv. S1092734 i want to delete the first letter in all those records.

View Replies !
Delete Column Names On A Match
I have a table with attributes like this:

catA_totals
catA_averages
catA_median
catB_totals
catB_averages
catB_median
catC_totals
catC_averages
catC_median
catD_totals
catD_averages
catD_median
.... etc

and I decide I no longer want to have the median tables, how can I select all these tables and drop them... something like drop *._medians or something like that.

I saw the alter table can use multiple drops, but only when all the column names are explicitly typed.

View Replies !
Script To Connect To Delete Contents Of A POP3 Mailbox
I have written a PERL script that I can run through bash, that will take in a mail server address, username and a password, login and then delete all of the mail contained within the user's mailbox.

Now I've battled to create a web interface so that my non-linux colleages can use easily wherever they happen to be, but just cannot get to work.

So, I decided it would be easier to use PHP to create the script and use $_POST to grab the address, username and password from a form and then process the connection/deletion.

View Replies !
Read Contents Of An External XML Page And Then Parse Its Contents
I have a URL that generates an XML page. I'm trying to read its contents and parse the information. But, I keep receiving these error messages: Code:

View Replies !
Merge The Contents Of One Array Into The Contents Of Another.
There are many times when I need to merge the contents of one array into the contents of another. Below is how I make this happen now. Do you know of a better or quicker way to do this? The main reason I am concerned is that the arrays I'm merging now have 40,000+ items in each array. I want to streamline the process if possible.

$arrayA = array('item0', 'item1','item2');
$arrayB = array('item3', 'item4', 'item5');

for($i=0;$i<count($arrayB);$i++) {
     $arrayA[] = $arrayB[$i];
}

print_r($arrayA);

View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong?

<?
include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$id="delete from todo where id='$id'";
mysql_query($id);

mysql_close();
?>

View Replies !
How To Query From One Column Then Sort Using Another Column
I am trying to get the last 100 albums I entered into my database using the album_id (Highest being the latest entry) then sort them alphabetically using the album_title column.

I can get the latest 100 easily but cannot figure out how to also sort the results by the album_title before I display them.

This is what I have so far which gets what I want but not in alphabetical order.

<?php
$sqlquery = mysql_query("SELECT * FROM albums ORDER BY album_id desc limit 100", $db);

while ($result = mysql_fetch_row($sqlquery))
{
echo "<a href='music_info.php?album_id=$result[0]'><span style='text-decoration: none'>$result[1]</span><br></a>";
}
?>

I have been trying to add a second ORDER BY to the query like so.

$sqlquery = mysql_query("SELECT * FROM albums ORDER BY album_id desc limit 100 ORDER BY album_title", $db);

but this obviously isn't the way I should be doing it.

View Replies !
Paging And Sorting Column By Column Name?
I am using below code to paging my data. I want to sort my data by Column time. Not getting where i do changes. Code:

View Replies !
Mysql Delete - $query = Mysql_query("DELETE
how would i do the following ?

$query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt  WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error());
im just getting "Unknown table 'notes' in MULTI DELETE" ?

View Replies !
Same Contents
i have an array that i have created by exploding a string that is comma seperated

(for example my string was 1,2,3,4,5,6,7,8,9 and now i have this as array[0] = 1 etc etc)

What i am wondering, is if my string was more like 1,2,3,5,6,7,1,1,1,8,9,3,3,2,2 could i search the array and find what appears most frequently in the values (in the above case 1)? So if 1 has 4 occurences, then i echo this value first,then 3 which has 3 occurrences (etc etc)

I am trying to make a basic tagging system for my website,and i want the tags that appear most to be displayed first or in a bigger font or something.

View Replies !
Contents Through Php
i think declered it self as a zip archive. now in the php script it wrote files and generated the zip file for download. He did this when i had this php file genberate a txt file and then after the user clicked on download theyed click on delet file link and it would delet the file. But with that script it never really wrote or deleted anything. It was just generated for that one dl.

View Replies !
File Get Contents()
I need to verify, (working on the HTML section of a mailer), If in my php.ini: allow_url_fopen is On Will file_get_contents(file URL) called as follow:

$mailer->Body = str_replace('{MEMBER_NAME}', $member_name, file_get_content($htmlBody) );

Allows the file to become my email body? where $htmlBody comes from the DB...

View Replies !
Getting And Using Contents In A Folder
I want to make a photogallery/slideshow with PHP...

The 'gallery/slideshow' would show up inside a new window.
basically, I just want links with possibility to go:

- forward
- back
- to the very beginning
- to the very end
- away (close the window)

Can I use PHP to determine the contents of the folder with the pictures and then use variables to determine which photo to show, and what URL's should be generates for the arrows? So each folder with a series of photographs would have one PHP file and the pictures themselves in them (it's not a problem to rename them).

Should be simple enough, but I'm just starting out with PHP, and I'd like to have something working as soon as possible... the website I'm working on is about to launch soon (my first 'commercial' web project :) ), and this is about the only thing left that I still have to sort out how to do...

View Replies !
Add The Contents Of 2 Texbox's
I have designed a form that will display a price (22.34) in
a text box, and another price in the other text box... I also have a blank
text box... Now I want to add both the prices together and get a total in
the bloank textbox..
I got this example off a website sumwhere.. But it does not display the
decimal number, it only displays the whole number

var number1 = parseInt(document.forms[0].CasesSellingPrice.value);
var number2 = parseInt(document.forms[0].AccessoriesSellingPrice.value);
document.forms[0].total.value = number1 + number2;



View Replies !
Getting Address Bar Contents With PHP
How do I get the contents of the browser address bar with PHP - assuming it
is possible?

In javascript it is done with: unescape(window.location.pathname), but is
there a php equivalent?

View Replies !
Refresh The Contents?
I have a php page containing a dynamically generated list. Once the list is displayed the list only refreshes when you select refresh in the browser, how can i get it to refresh the contents?

View Replies !
Getting Contents Of Folder
I've made half of the code for a little "hosting" site for a few of the members of my site. Their files are uploaded to /login/<username>/

I'm now stuck as to how to show the contents of the folder in a page. I think the use of fopen() is needed, however the php website is a little confusing.

View Replies !
List Db Contents
can someone help me make a script that will list the information in one colum in my table! See each clan I have has an ID, and CEO and bla bla bla! But what I want done is it to only show the name of the clan in A dropdown menu. So that when users are signing up they can select the clan they want and it well ya you know puts the name beside theres in the table. But can someone make me a script to list all the clans Names and only names not ID, Ceos, and all that other stuff. Code:

View Replies !
Getting The Contents Of A File.
Is it possible to get the contents of a file; display the contents in a textbox; and edit the contents of that file. Then click a button and change the contents to the new updated file.

The reason I want to know this is because I have programmers on my site and I don't want them to have access to the FTP or cPanel. They will jus enter the name of the file, click submit, be able to edt and replace that file. All without FTP or cPanel.

View Replies !
Display Contents In Mb/gb
i was wondering if it was possible using php to display how much in mb or gb how many files in  afolder e.g

folder <-- containg 1,000mb of data

View Replies !
File Put Contents
looking to write to a file with out overwriting the previous data?  is there a way to turn overwrite off with the file put contents?? im trying to keep a log of form data.

View Replies !
File Get Contents
i am trying the example of get_file_contents but i get the following error.

what i want to do is get all the web page of google but the code wont work any ideas please cheers.

Warning: file_get_contents() expects at most 2 parameters, 5 given in

<?php
$content=file_get_contents("http://www.google.com",FALSE,NULL,0,20);
echo $content;
?>

View Replies !
Load The Contents
I want to be able to load the contents of a text file into a couple different form fields. So like title and body would be two different input fields. The script would somehow seperate the title and the body in the text file so it can be redistributed to each input field when I go to edit it. then be able to change it and then hit the submit button to overwrite the old contents with the new contents.

View Replies !
Getting File Contents
I am trying to get the contents of a txt file and add a number to it and then store the sum of that equation in the file Code:

View Replies !
Contents Of A Folder
I want to put the contents of a folder into an array. Say a folder called data has index.php and text.txt in it. Now I code $files=get_contents_of_folder('data'), and that makes this: $files[0]='index.php' and $files='text.txt'.

View Replies !
Emailing Contents
I need php code that will allow me to email the contents of a form to an address. If searched the internets but am new to php and dont know where to put parts or what to do. I also have just a javascript thing to check if values are entered into the text boxes before it allows the submit button to be pressed. Someone please help.

I need to know how to email the contents of textboxes in a form as well as keeping my javascript alerts so that all boxes are filled.

View Replies !
Contents Of Php File
am having a problem with require/include parsing .php files. It works fine for html, but for some reason when I include .php files, the page displays my actual php code as plain text. Yet it also seems to execute said code after displaying it.

View Replies !
Get Contents Between Two Markers
I am trying to build a web based php editor for myself to make editing pages easy. Most of the various bits and pieces I can easily include, by including varibles into text input fields. Just one problem remains, how to edit PHP in it? What I thought of doing was to use something like strpos of two different tags;

ob_start();
require_once("index.php");
$buffer = ob_get_contents();
ob_end_clean();

$pos1 = strpos($buffer, "//extra php here");
$pos2 = strpos($buffer, "//end extra php");

However this does not seem to work - maybe it is because there are spaces in the string - but how can I get the positions of these two markers in the $buffer - or is there a better way of doing this? I would also need something to get rid of everything at the beginning up until the marker, and everything after the 2nd marker. The only thing I have thought of, is to perhaps create another file to contine the extra PHP code in - but why increase used disk space, whilst also possibly letting the users see source code.

View Replies !
Send The Contents
I have a form on my website that uses arrays. Basically I can't figure out how to send the contents of those arrays in the body of an e-mail using the mail() function. If I try just putting the name of the array like $array it will just send the text "Array" to my mailbox, which is normal. Unfortunately, the usual means of displaying the contents of an array such as "while (list($key,$value) = each($array)" won't work in the mail function. is it possible to send the contents of my arrays in the body of an e-mail and if so how do you do it?

View Replies !
Contents Into Html
Does anyone knows how to convert word document into html?

View Replies !
Getting The Contents Of A Website
Can someone point me in the right direction of how to get the contents of a website and display it on my own web page.

View Replies !
List Contents
Is there any way in PHP to list a folders contents??

View Replies !
Printing The Contents
i just want to provide users of the my website by providing them a button. When users click on the 'Print This Document' button, i want the php code to search a default printer in their system and print the content of the page. How can i do it.

View Replies !
Stream Get Contents
this shows what the content is, but for some reason, its not writing. code:

<?php

$file = fopen("/home/gamesjet/public_html/test.txt", "a+");
if ($stream = fopen('http://www.example.net', 'r')) {
// print the first 5 bytes

$contents = stream_get_contents($stream, 100000);
echo $contents;
$post = file_put_contents($file, $contents);

echo $post;

fclose($stream);

?>

View Replies !
Column To Use?
I have a table with the following:

upn|parent_upn|description|etc etc

What I want to do is, when the parent_upn is not Zero, I want it to select the parent_upn as the upn column.

I was thinking something like this:

SELECT IF(`parent_upn` != &#390;', `parent_upn` AS `upn`)
ELSE(`upn` AS `upn`)
FROM `products` WHERE ......

This doesn't work, what am I doing wrong.

View Replies !
Deleting Contents In File With PHP
Hi, I need to get to a specific part of the file and delete a line so i can overwrite it with a new value. Example ...

$Money = array(
0 => 10000,
1 => 932394,
2 => 3254#<Money>
);

I need to change first choice "0 => 10000" and replace it with "0 => 7500" so it seems like they spent 2500 moneys I dunno if its possible but if it is please help, and thanks in advance FYI, the file is called testfile.inc and i dunno what that .inc means :P I just got it from a script i downloaded Further more, i want to do this change/replace through a form or a click using PHP.

View Replies !
Displaying Directory Contents.
Is it possible to display the contents of a directory onto a page with php? Is there a certain function for it?

View Replies !
How Do I Email The Contents Of A Webpage?
How do I email the contents of a webpage?

My project is coming along nicely and I have it almost completed.

It started with putting data into a mysql database and allowing people to
select items wanted from a big list. I now can update the database with the quality wanted and I can generate an email to the person however I cannot get the list of items wanted into the email.

The list is coming from a mysql database based and comes up in a table type
format

My question is how do I get the information from the 2nd page into the body
of an email?

View Replies !
File Get Contents Issue.
In folder WWW i have text file named news.txt. I'm calling file_get_contents("news.txt"); form index.php in the same folder. I got error:

Warning: file_get_contents(news.txt): failed to open stream: No such file or directory in /home/www/index.php on line 14.

View Replies !
File Get Contents - Timeout
I Have googled and founds lots of references and examples of stream_set_timeout for fsockopen, but none showing how you apply a timeout to file_get_contents which I need to use in this case.

Can anyone give me a sample of how to set a timeout on file_get_contents, as I understand that it can be applied to all PHP streams?

This does not timeout after 2 seconds:

$url ="http://www.mydomain.com";
stream_set_timeout($contents, 2);
$contents = file_get_contents($url, false);
Print $contents;

View Replies !
File Get Contents() Error
I made a PHP5 script that uses the file_get_contents() funtion and when I run the script, I get this error:

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration

I called my host up and they said that it is a coding error, not a security or server error,

Here is the code:

<?php
$address = "http://www.example.com";
echo htmlspecialchars(file_get_contents($address));
?>

View Replies !
Comparing Array Contents
i'm having a small problem with getting information into a database. Basically, i've got a form with some elements in it, such as:

name phone address

for example. I pass these values to a function which finds out whether the action is associateds with the form is to insert, update or delete info from/to the database (using an HTML "hidden" field.)

The field names in my database are the same as in my form. (name, phone etc...). Using mysql_fetch-field, I have an array with the field names in it. I read the values passed from the form into an array called $values with the form fields as keys ? I would like to set the entry as 'NULL' for each field in which there is no data to enter. I thought the best way to do this was by comparing the contents of both arrays, and where there was a key in $values corresponding to the fieldname, somehow assign the contents of $values to that fieldname in the query.



View Replies !
Put Contents Of XML File Into An Array
I need some way to generate an array that holds the same structure and data of a xml file.

View Replies !
File Get Contents .limitation?
See this simple file_get_contents code

<?php
$link= 'http://www.example.com'
$content=file_get_contents($link);
echo $content;
?>

I tried the code with these links:

1. http://www.example.com (...worked OK. Also tried google.com, yahoo.com,... all OK.)

2. http://www.example.com/buy/chess (...$content captured an error page instead of the result)

3. http://www.example.com/chessmotifs (...$content returned nil, ... totally nothing. This is the one I need the code to work btw.)

Could this be because the site (in this case cafepress) uses some sort of scripts to generate their sub-pages? If yes, is there an alternatif method to "file_get_contents" that allows a page to generate fully before capturing?

View Replies !
Size Of Variable Contents...
We are trying to debug a program that queries an oracle database
and reads a LOB.
Somewhere along the line from the db to the screen, an initial cr
gets added.

We can read out the LOB fine using Tcl/Tk, so we know the database
data is correct.

We now like to know when the additional char gets added, between
reading the lob and displaying it.

View Replies !

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