php

PHP MySQLi and MySQLi_STMT: Which insert_id to use?

Hello all, Both the MySQLi and MySQLi_STMT classes have an $insert_id property. If I am connected to my database using a MySQLi object (say $db), and then I perform an INSERT with a MySQLi_STMT object (say $stmt), to get the id of the last INSERT, should I use: $last_id = $db->insert_id; or $last_id = $stmt->insert_id; Or would ...

Store data for songs MySQL DB

I'm storing a huge set of songs in a MySQL database. This is what I store in the 'songs' table: CREATE TABLE `songs` ( `song_id` int(10) unsigned NOT NULL auto_increment, `song_artist` varchar(255) NOT NULL, `song_track` varchar(255) NOT NULL, `song_mix` varchar(255) NOT NULL, `song_title` text NOT NULL, `song_hash` varchar(...

PHP - ftp_get only works once

I'm connecting to an ftp server that I have no control over, and I'm pretty sure is using something old and outdated due to other issues I've run into. I'm simply using this code in a loop to get all the files in a directory. ftp_get($this->conn_id, $remote, $local, FTP_ASCII); The first time all goes well, but after that I get this ...

PHP array ordering

Hi, I was wondering how I could sort this array, when I use asort right now it does 14 17 16 15. How would I go to have 14 15 16 17 array(4) { [15]=> array(9) { [2025]=> string(80) "20:25 à 21:15 Spectacle / L'histoire d'un coeur / Auditorium, É.S.P. De La Salle" [2135]=> string(71) "21:35 à 22:25 ...

Insert hundreds of rows into Google spreadsheet with Zend Gdata?

Inserting rows one by one from a 600 record data-set is taking almost an hour, using the following method: foreach($people as $person){ $insert['name'] = $associate -> name; $insertedListEntry = $spreadsheetService->insertRow($insert, $spreadsheetKey, $worksheetId); } Is it possible to insert multiple rows at once? ...

Disable popup message in php

When i upload a excel file, i have used COM() to open and automate converting it to xml. It works fine, But when i run it, it always shows the message from Microsoft Excel: A file named ''' already exists in this location. Do you want to replace it? I can choose between Yes No and Cancel. normally i would choose Yes. But i dont want us...

OCI8 functions not found when run by apache with php5

I'm trying to set up a server for a project in my databases class. I'll be writing the project in php, deploying it via apache, and connecting to a remote oracle server. I'm having trouble with the oracle connection portion. I have the OCI8 module installed with oracle's instantclient version 10.2. I thought it was working because when I...

.htaccess add hidden php get variable for language selection

I have a multiple language website, and I use a php get variable to set the cookie for the language setting. I have multiple subfolders (http://www.site.com/es and http://www.site.com/de) that each have a respective .htaccess file. When accessing these folders, the .htaccess file does this to "silently" redirect the user and add the ap...

XML array with 2 href attributes

I have the following XML array: ["link"]=> array(2) { [0]=> object(SimpleXMLElement)#311 (1) { ["@attributes"]=> array(3) { ["type"]=> string(9) "text/html" ["href"]=> string(48) "http://twitter.com/bob/statuses/...

Php error in closure compiler execution

When I run php-closure i get a PHP error Undefined index: HTTP_IF_NONE_MATCH in <b>/php-closure.php</b> on line <b>183</b> Line 184 of php-closure is trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) { This error only happens when closure has already written the compressed javascript file to the directory once, if the directory is em...

PHP: How to find most used array key?

Lets say I have a simple 1D array with 10-20 entries. Some will be duplicate, How would I find out which entry is used the most? like.. $code = Array("test" , "cat" , "test" , "this", "that", "then"); How would I show "test" as the most used entry? ...

php gd image quality

I 'm trying to add text on a specific image. Its working perfectly but the quality of image is low especially for papyrus.ttf font. How can i improve the quality of text in the image. But i need high quality to print the output. Here is my code.. its very simple. header("Content-Type: image/jpeg"); $im = imagecreatefromjpeg("cosmos.jpg"...

preventing direct access to a php page, only access if redirected

Hi, I want to make my php page just can be accessed by another page redirect, and want to prevent my user directly access to it. i mean, lets say i have a page called "main.php" and other php file that i want to prevent direct access called "noaccess.php". I want to make noaccess.php file accessible if i only redirect from main.php ...

PHP Script to resize transparent png images

Could anyone link me to a sample script that would allow be to resize PNG images containing transparency? Some scripts I tried create a black area in place where the image was transparent. ...

Fetching content from Website on another Server

Hi everyone. What i basically want to do is to get content from a website and load it into a div of another website. This should be no problem so far. The problem is, that the content that should be fetched is located on a different server and i have no source access to it. I'd prefer a solution using JavaScript of jQuery. Can i use a ...

In, PHP, what is the "->" operator called and how do you say it when reading code out loud?

In, PHP, what is the "->" operator called and how do you say it when reading code out loud? ...

PHP submit problem

I'm trying to check if the username is available and display it for the user to see when they check there account settings, which I have done. BUT when the user tries to fill out another field I get the Your username is unavailable! which should not pop up because its the users username already. I want to know how can I fix this proble...

What's the meaning of the PHP Token Name T_PAAMAYIM_NEKUDOTAYIM

What's the story behind the ::'s sometimes token name T_PAAMAYIM_NEKUDOTAYIM I'm mainly interested in knowing if This is an abbreviation for something else This is a phrase in a language other than English, and if so what's the language and what's a rough translation This is some obscure-to-me programming term Drunk Developers T...

MySQL LEFT JOIN issue with three WHERE statements

I am building a note taking app for myself with tag filtering functions, but am having an issue when trying to grab notes with the tags. The tag filter needs to use AND not IN, because it will help better narrow down what I am looking for. My tables are configured like this: + notes note_id | note_title | note_uid + tags...

Integrating legacy Ajax script in CakePHP

Hi, I have a legacy script that I would like to integrate in a cakephp app. The script makes use of $_POST and such and since I'm quite a noob I would need some help for the integration. Here is how the script looks like: THE JAVASCRIPT: prototype.js builder.js (these two are from the prototype fw) lib.js (makes a ajax requests to r...