php

PHP - How to get, and display the biggest values from a database?

Hello. Can anyone tell me how to get and display the biggest values from a database? I have multiple values in my database with the heading "gmd", but how would I get only the first 3 biggest ones to be displayed? How would I do it in this example: $query = "SELECT gmd FROM account"; $result = mysql_query($query); while($row = mysql_...

How to delete an image using PHP & MySQL?

I was wondering if some one can give me an example on how to delete an image using PHP & MySQL? The image is stored in a folder name thumbs and another named images and the image name is stored in a mysql database. ...

php image upload

How to make a basic PHP uploader? I want my images to save in my htdocs/myfolder/.... Here is my code: <form enctype="multipart/form-data" method="post" action="img_uploader.php"> <input type="file" name="fileToUpload" /><br /> <input type="submit" value="Upload File" /> </form> ...

Stored Procedure: Variable passed from PHP alters second half of query string

Hello everyone, Basically, we have an ASP website right now that I'm converting to PHP. We're still using the MSSQL server for the DB -- it's not moving. In the ASP, now, there's an include file with a giant sql query that's being executed. This include sits on a lot of pages and this is a simple version of what happens. Pages A, B and...

How to get SEO-relevant site statistics using PHP?

My goal is to get various SEO-relevant information for various sites. Basically all the stuff you see in SEO toolbars for your browsers (Page Rank, amount of links, position in search results, etc.). But what's the best way to get this information? Where do these toolbars get it? Do they have their own indexing scripts and databases, or...

.ics Calendar File - Parsing Date Time - What is the time format?

I am coding in php, attempting to get the start\end dates and times for events. I am utilizing the following RegEx for parsing out the information: $pattern='/(?P<StartDate>[0-9]{8})T(?P<StartTime>[0-9]{6}) .+(?P<EndDate>[0-9]{8})T(?P<EndTime>[0-9]{6})/'; The sample event entry is here: BEGIN:VEVENT UID:34b09fd7-8e6e-4d56-86b0-445745...

Mysql stored procedure where clause

Ok let me try this again. query("CALL getemployee('$eml')"); $result = $sql->fetch_array(); ?> This is my stored procedure: Delimiter // Create procedure getemployee(in eml varchar(50)) Begin Select * from employees where email = eml; End// Delimiter ; The error i get from browser: "Fatal error: Call to a member function fetch_ar...

PHP loop position

Can someone help me on this. I'm made an image uploader and i want the image to make another tr if it reach to 5 pics so it will not overflow. Here is my code: $dbc = mysql_connect("localhost" , "root" , "") or die (mysql_error()); mysql_select_db('blog_data') or die (mysql_error()); $sql = "SELECT * FROM img_uploaded"; $result = mysql...

PHP & MySQL delete image link problem

I'm trying to create a delete image link if the image is present and when the user clicks the delete image link it should delete the image. But for some reason this is not working can someone help me fix the delete image link problem? Thanks! Here is the PHP code. if (isset($_POST['delete_image'])) { $img_dir = "../members/" . $us...

how to get PHP URL

I have a photo gallery and to have there url in there bottom. How can I do that in PHP? the location of file is in http://localhost/jordan pagaduan/user_images... ...

php feed parsing - What's wrong with this code?

This code was working, but now it doesn't! Can anyone help? $rss = simplexml_load_file("http://search.twitter.com/search.atomlang=en&amp;q=charlton&amp;rpp=100&amp;page=1"); foreach($rss->entry as $item){ $title = $item->title; print "$title"; } ...

php: delete word from sentence

i have the sentence something about something WORD still something... what is the most efficient metod to delete the word "WORD" from sentence in php? thanks ...

Good error flagging | PHP

For everyone that was thinking of the error_reporting() function, then it isn't, what I need is whenever a MySQL query has been done, and the statement has like if($result) { echo "Yes, it was fine... bla bla"; } else { echo "Obviously, the echo'ing will show in a white page with the text ONLY..."; } Whenever statements have b...

How can I dump a loaded mib out of PHP

I loaded a mib into PHP with a ton of OIDs. I'd like some way to dump those out and run through them. I didn't find any way on the php website docs to do that. ...

How can I convert a bunch of files from ISO-8859-1 to UTF-8 using Perl?

I have several documents I need to convert from ISO-8859-1 to UTF-8 (without the BOM of course). This is the issue though. I have so many of these documents (it is actually a mix of documents, some UTF-8 and some ISO-8859-1) that I need an automated way of converting them. Unfortunately I only have ActivePerl installed and don't know muc...

Get 10 Most Entered Entries

Hi, I'm just wondering if it's possible to retrieve the the most entered entries from the mysql database It's like this : ID - Value Id is auto increment, and value is the text that is being entered, i'd like to have it display the top 10 most entered terms, how could i do that? ...

phpFlickr: how do you determine the width of an image and resize it accordingly?

Using phpFlickr, I need to have 100x100 square thumbnails coming from Flickr. The problem I'm having is that using a larger size via the API such as the Small, the vertical oriented images will be distorted when resized to 100x100. I was using CSS to do this. How can I distinguish between the vertically or horizontally oriented images b...

Where to get 1440 free cron jobs a day?

I'm making a program for my own use. In this program, I need to set up cron job. The cron job should run every minute (24 hr * 60 mins = 1440 times). Thus, I'll need to set up a cron job with a frequency of 1 minute. I think Google App Engine gives free cron job. But I'm very new to it. I downloaded the java SDK and read the document bu...

PHP & MySQL Image deletion problem?

I have this script that deletes a user's avatar image that is stored on the filesystem. In addition, the image name is stored in a MySQL database. But for some reason the script deletes all the user's info. For example if the users_id is 3, all of the user's info like first name, last name, age and so on, are deleted as well. Basically...

Read line comments in INI file

The parse_ini_file function removes comments when reading configuration files. What would you do to keep the comments that are associated with the next line? For example: [email] ; Verify that the email's domain has a mail exchange (MX) record. validate_domain = true Am thinking of using X(HT)ML and XSLT to transform the content i...