Trying To Alter A Table Value Once Its Corresponding Date Has Expired
I've inherited a site that runs a simple jobs board script and am completely stuck.
When the $job_date_end field has passed then the job as expected, ceases to be live on the site. In the back-end admin section there's also an option to suspend a job. What I want to do is add a line of code that reads whether the $job_end_date has passed, and if so, suspends it $job_status=1 Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Alter A Table
I have the following table with lots of data in it: CREATE TABLE /*!32300 IF NOT EXISTS*/ [db_prefix]reference_lang_spr ( id bigint(11) NOT NULL auto_increment, table_key int(3) NOT NULL default Ɔ', id_reference int(11) NOT NULL default Ɔ', lang_1 tinyblob, lang_2 tinyblob, lang_3 tinyblob, lang_4 tinyblob, lang_5 tinyblob, PRIMARY KEY (id) ); I would like to alter the table fields datatype for tinyblob's to text fields which is equalant in size of tiny blobs. I do have lot of data in the table. is it possible to alter the table.
View Replies !
Using ALTER TABLE And FULLTEXT
I am running the following: mysql_query("ALTER TABLE reviews ADD FULLTEXT (title)") or die(mysql_error()); mysql_query("ALTER TABLE reviews ADD FULLTEXT (body)") or die(mysql_error()); $result = mysql_query("SELECT movieId, title, MATCH (title, body) AGAINST ('" .$row['title']. "') FROM reviews WHERE MATCH (title, body) AGAINST ('" .$row['title']. "')") or die(mysql_error()); but I keep getting the error "Can't find FULLTEXT index matching the column list". Is my syntax right on the first two lines? This is going to be used to gather related articles based on the currect articles title and echoed as such.
View Replies !
Alter Table If Field Or Column Not Exist
Myscript should alter the table if the field or column not exists. I try this but its not working. fieldname = image $DB->query("ALTER TABLE `p17_sections` ADD `image` VARCHAR( 24 ) NOT NULL AFTER `sorting` If not exists");
View Replies !
Expired Article - Comparing Today To Expire Date
On my front page I have a list of articles that are pulled from my database. I have just added a column (expires) to the db in order to remove outdated articles. I'd like to compare today's date to the expires date in my WHERE statement to exlude all articles where the expires date is older than today. But I'm at a loss right now on getting it to work.
View Replies !
Store Date In A Date Field In My MYSQL Data Table
I have a form with a feild that when clicked on pops up a calendar which I can select a date I wnat to insert into the field. The date inserted displays "03 Apr, 2007". I want to store that date in a date field in my MYSQL data table, a field named "f_date" set to date type. When I save the record the data field "f_date" displays "0000-00-00" which I take it the date input is not getting inserted to the table. My insert field code is PHP Code: <input name="f_date"Â Â type="text" class="bodytext" id="f_date" onclick='scwShow(this,this);' value="" size="15" />
View Replies !
Save Date To Table Field Date Type
I have a calendar picker on a form that fills a text box with XX/XX/XXXX date format. If I run a insert statement the date field in the database shows 0000-00-00. If i change the field type to varchar the correct format displays. What is the correct way to save a date to a mysql database? Furthermore to query on the date how about a select * from db_name where servicedate >= $startdate and servicedate >= $enddate I supose this will not work Any pointers?
View Replies !
New Table On New Date
I want to sort by date descending (that works !) but i want to make some kind of listing that all events that happen on the same date, are placed together (in a small table). so like this: DATE NR 1 event 1 event 2 event 3 DATE NR 2 event 4 Date NR 3 event 5 event 6 and so on. The information is stored in a databasetable called 'events', date is placed in the field 'date'.
View Replies !
Date Table
I am just curious if this can be done. I have this test form that I am setting up which will be inserted into the final page once I get all the forms built and working. I am currently working on this form. Code:
View Replies !
Seeing If A Date Is Between Two Dates In A Table...
I have 2 fields in my table, (date1 and date2) with date1 = 2007-08-01 and date2 = 2007-09-30 I'm trying to run this sql statement: SELECT * FROM discounts WHERE discType = 'Date Range' AND date1 >= '2007-09-15' AND date2 <= '2007-09-15' and it won't return any rows... is there a way to see if a date is between 2 days in a table? (btw.. 'Date Range' is valid.. so thats not it)
View Replies !
Pullout Date From Table
I have a table with more than 50 columns. I named the column with order, for example, sub1, sub2, ....sub54. When extracting data from table, to save time, I wanted to use a while loop as following: Code:
View Replies !
Alter Box
ive written this if statement and i want an alter box to appear when the wrong username and password is entered...however i also want the page to redirect the user to the login page once they click ok the to alter Code:
View Replies !
Default Date In Mysql Table
I had a table with a DATE column with default value 0000-00-00, but it is optional that is user can enter a date or just leave it blank. How do I do to ensure that: 1. the date inserted will be 0000-00-00 and not 1970-01-01 2. when the table is updated and IF there is no changes to the DATE column, it will still holds the value 0000-00-00.
View Replies !
Finding The Oldest Date In A Table
I am tring to find the oldest date in a table where the date column name is "completed" Quote: // find the oldest item $query = "SELECT completed FROM ipn_tblsaleshistory"; $result = mysql_query($query) or die("couldn't execute query"); I have selected the table and could use a while loop but am hoping there is a more elegant way - I have tried looking up SELECT on the PHPBuilder manual using search but get the error Not Found The requested URL /manual-lookup.php was not found on this server.
View Replies !
Create / Alter A PDF
I'm having alitte trouble finding the right solution to my problem, so hopefully you can help me out. I want to change some content in a PDF file with PHP. The way I tried was generating a LaTeX document and changing the text in there, before converting it to PDF, but since I need a specific layout including textboxes and stuff, I dont think LaTeX can handle that. Another way would be generating the PDF directly with FPDF or PHPLib inPHP, but I think there will be a similar problem concerning the layout. Do you have any ideas or advice?
View Replies !
Alter A Csv To Sql Script
I found a script on codewalkers, but needed to modify it. Its a csv2 sql converter. Below is my partly modified script.<H2>CSV to SQL convertor</H2> Code:
View Replies !
Group By Date - Data On A Mysql Table
so i got some data on a mysql table that i want to group by date i was thinking of SELECT song_name,DATE_FORMAT(date, '%m - %d - %y') as dates FROM tra_artist_song GROUP BY DATE how do make every data under the same date appear under that date
View Replies !
Date Fields In A Table - Last Updated, Next Check Due Etc.
Basically I have a few date fields in a table - last updated, next check due etc. There's also a DateAdded field which defaults to the date the record was created. The default format was 2008-01-01, but I've got that displaying using a recordset in Dreamweaver : SELECT date_format(DateAdded, '%%D %%b %%Y') as formatted_date FROM developments WHERE DevelopmentID = %s", $colname_dateformat1); This is fine. Following this principle I've done another couple for other dates and dropped them in. For dated I'd already added in the 2008-01-01 format, they display correctly. But my problem now is with entering them - as far as I can tell I'm drawing a blank with either 2008-01-01 or '%%D %%b %%Y' What's the best practice for entering them in the first place?
View Replies !
Add The Current Date:time On New Table Insertion
how do i make MySQL add the current date:time on new table insertion. - want to know if there is such an option that makes the MySQL db add the date:time data to a table collumn on it's own. - also, how do i make MySQL auto-increment a collumn var whenever it's being read.
View Replies !
Storing The Current Date In Mysql Table
I have a table called date_time.it has 2 fields. field-name datatype 1.date date 2.time time i want to store the current date and current time in that table.when ever i fetch the date and time it should display the current date and current time.
View Replies !
Retrieve Data From A Table By A Specified Date Period.
I am trying to retrieve data from a table by a specified date period. There are multiple entries for each date and I need to display them on the page by the date and then all the entries for that date. I know that I need to use GROUP BY in my sql query, I am just having a hard time figuring out how to do that and then how to display the results on the page.
View Replies !
PHP To Alter Flash Movie
I'm not sure if I've posted in the right place, so feel free to let me know if I haven't. I've a situation where I would like to modify values in a flash.exe using PHP where flash.exe is a flash movie which is download and runs on the client side. The reason for this is, I've an online form where I want the values to be submitted to an app for users to download. Each time the user runs the app on their machine it should have the values that they submitted online. Is this possible?
View Replies !
Alter The Order Your Colums Are In In The DB
How do you alter the order your colums are in in the DB. I forgot to put my ID in at the begining and It's just easier to look at with it up there. I think my productivity today is at an alltime low. I even had to look up how to escape special charicters, the date() function, and how to write for() statements. It's like everyting I know aboult mySQL and PHP decided to take the day off. I even made myself look like a fool infront of one of our directors.
View Replies !
Alter A MySQL Column With Php
I have a table named sentcards with a field called cardid with a current type int... I wish to change the type int to bigint(30) with an attribute that is unassisgned and a default of 0... This is my code:
View Replies !
How To Alter Last Iteration In A For() Loop?
Currently I have a for() loop building a query for me. The code is as below for ($i = 0; $i < count($array); $i++) { //removes characters in $chars from $array items $chars = array(" ", "&", "(", ")", "/", "-"); $trim = str_replace ($chars, "", $array[$i]); $query1 .= "$trim, "; $query2 .= "'$" . "_POST[$trim]', ";} $query1 = str_replace ("_1", "", $query1); $query = "INSERT INTO 2007_results (name, email, ip, $query1) VALUES ('$name', '$email', '$ip'," . $query2 . ")"; mysql_query($query); This is producing a $query that looks like this-- $query = "INSERT INTO 2007_results (name, email, ip, query1.1, query1.2, ) VALUES ('foo', 'foo@bar.com', '127.0.0.1', 'result1', 'result2', )"; Obviously that is producing a SQL error because of the extra comma and space inserted at the end of each iteration. The question is, how to remove the inserted ", " on the last iteration? There are many more inserted vars as part of $query1; I just shortened it for this example.
View Replies !
Alter And Create New Png File
I'm trying to take an existing png file, modify it in php, and then to create a new png, but haven't got it work yet. I've been trying with the imagecreatefrompng (http://us.php.net/manual/en/function.imagecreatefrompng.php) function, but always keep getting a black image, and not the updated modify image.
View Replies !
Ordering & Limiting Multiple Table Rows By Date
My goal is to select rows from two tables 'shoot' & 'video' and have mysql order those tables by date and limit the number of rows returned. I want to list the latest 10 rows but am uncertain how many rows from each table will be the latest. I may have more recent shoots than videos or the opposite. How can I use a single ORDER BY and LIMIT statement for both selections? Code:
View Replies !
How To Select Articles Of A Particular Date/year From A MySQL Table?
I want to select a particular month & year (May 2004) from a SQL table that keeps track of article by a variable called 'dateline' which is a 10-digit integer. eg. 961484400 I was wondering how to write SELECT articles which are dated May 2004 from this table. $sql = "SELECT id, article, dateline FROM articles ORDER BY dateline DESC LIMIT 3";
View Replies !
Mysql Field ALTER To Decimal(10,2)
I have a sql statement generated by phpmyadmin where i changed the field value of a table from "float" to "decimal(10,2)". here it is: ALTER TABLE `BMG` CHANGE `I_PLQ` `I_PLQ` DECIMAL( 10, 2 ) DEFAULT Ɔ' but i need it to also round the existing values up. for example: 2.4875 to 2.49 but for some reason it rounded it to 2.48, and i don't know how to change the statement so it will round values up for existing values in the field. is this even possible? if not, how would you handle it?
View Replies !
Alter Array Variable In A Form
I have recently found the need to create a page in php that displays, in this case, and list of items that someone is ordering, along with quantities. The initial entry page is simple and straightforward enough, except when it comes to passing all the data to post processing (i.e. the php program). The form would consist of multiple lines.. each with a sku, a description, a quantity and a price for example. Obviously the ideal situation is to somehow pass an array such as $order[$i]['column'] where $i represents each line on the form, and 'column' is the actual field. But I havent found a way to do this. I have been able to code around it, by having the user choose an item one at a time. But, then, I am faced with the same issue later when I present the customer his order, and want to allow him to change the quantity before checkout, or delete a line. If you have tackled this problem and have been successful, please respond with your ideas, or just a simple reference to a good source that I could see an example would be fine.
View Replies !
Alter Font Colour Within Text Box
I have been trying to change the font colour within a text box. I have used a hidden box with echo but want to display within the box to continue the theme of my forms. I am stuck and been trying different methods, but with no joy any help would be greatly appreciated. current code this not working is PHP Code: <? echo ""; if ($percentage >= 87.5) { Â Â Â Â $color = '#00FF00' } elseif ($percentage >= 37.5) { Â Â Â Â $color = '#ff9900' } else { Â Â Â Â $color = 'red' } ?> <input type="text" name="percentage" value="<? echo '<b style="color:' . $color . '">' . $percentage . '</b>' ?>">...
View Replies !
Need To Alter An Email Validation Function
I've got a PostNuke site that gets hit constantly by spam bots. Most register from .ru email accounts and such. I need to block certain TLD's upon registration. The problem lies in the fact that the current email validation uses strict matching. For instance, it has me input the list of banned mail domains separated by a comma. If I attempt to put simply .ru, .ua, etc. it will not work. If I put inbox.ru, casinotime.com.ua, it will block those particular domains. Code:
View Replies !
Alter The Expiration Of A Cookie/session
i'm trying to alter the expiration of a cookie/session i have so that this particular page can be opened for up to 12 hours before the session expires and the user is redirected to a new page. My code, however, is not working. It redirects after default session expiration. Here it is: $expireTime = 60*60*12; session_set_cookie_params ($expireTime); require_once("includes/session_set.php"); this is session_set.php: session_start(); if(!isset($_SESSION['id'])){ header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php"); ob_end_clean(); exit(); } define("ID", $_SESSION['id']);
View Replies !
Can U Alter A Sess Variable Twice In The Same Page?
in a project i have a session variable which i always reset in header and if needed i put a value after. in FF works in IE 7 work's on login page not in another (both are combined with AJAX but in second case the re-assigining does not work despite is shown on echo in browser it's not written in php session file);
View Replies !
Multiple Table Posts Based On Date - Explanation Inside
I've tried googling this and I've tried researching problems similar to this, and have been unable to find anything up to this point. Based off my peers, I've always learned that you research before you ask, because not using the search function can get you a quick smack in the head heh. I have a db with 7 tables, each table is for each corresponding day of the week. Code:
View Replies !
Creating Configuration Page To Alter Config.php
I'm creating a web-based database thingy for the organisation I work with- and of course there are a bunch of variables that I don't want to be touched by end-users, but then there are a few that I do want to be changeable by a 'super-user/moderator.' I'm trying to come up with the best way to create a 'configuration' part of the 'admin' section, which has the options to change, which will then open the particular file (let's say config.php) and edit those particular variables.
View Replies !
Alter PHP Script To Provide Automated Response
I have a website that has feedback form, customers enter details and a php script sends the information to my email address. I would like this changing so that an automated response is sent to the customer to let them know we have received the information and will contact them shortly. I would like this email to contain the information we are sent so they can see if it contained any errors. The current PHP script that I am using is shown below: Code:
View Replies !
How To Alter Script So Button Will Go To URL Not To Create Account
I have a "create account" button on my site which I would like to change the properties so it goes to a particular URL when clicked and not to the create account form. I think the following is the script I need to alter, but I could be way off the mark as I am very new to php. tpl_login_default.php <?php echo zen_draw_form('create', zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); ?> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CREATE_ACCOUNT, BUTTON_CREATE_ACCOUNT_ALT); ?></div> </form>
View Replies !
|