rkstevens
Members-
Posts
22 -
Joined
-
Last visited
Never
Everything posted by rkstevens
-
[SOLVED] Invalid date/time being displayed
rkstevens replied to rkstevens's topic in PHP Coding Help
I had just thought of that, and replaced the $variable with strtotime($variable) and it worked. Thank you. -
My database table has two values: PostDate that contains a timestamp when the record can be displayed RemoveDate contains the timestamp when the record can no longer be displayed The query: $newsquery = "SELECT * FROM News WHERE ((PostDate < 'time()') AND (RemoveDate > 'time()')) ORDER BY PostDate DESC"; returns 0 records, when there are ones that are within the range. I guess I have something wrong.
-
[SOLVED] Invalid date/time being displayed
rkstevens replied to rkstevens's topic in PHP Coding Help
I know I have one mistake, that the lower-case 'n' should be a lower-case 'j', but it still displays wrong: $formatdate = "l F j, Y g:ia"; -
[SOLVED] Invalid date/time being displayed
rkstevens replied to rkstevens's topic in PHP Coding Help
Displays: 1969 December 12, Wednesday 7:33pm -
I have the following code: $formatdate = "l F n, Y g:ia"; echo (date($formatdate,$concertinfo[EventDate])); $concertinfo[EventDate] is a timestamp stored in a database with the value of: 2008-08-20 20:00:00 but when I display it using the above date function, I get: Wednesday December 12, 1969 7:33pm What do I have wrong?
-
[SOLVED] Query runs in phpMyAdmin but not in program
rkstevens replied to rkstevens's topic in PHP Coding Help
DUH I think it's past my bedtime. -
I have the following code: $showtypequery = "SELECT * FROM ShowType WHERE StypeID = '$u_showtype'"; $showtypedata = mysql_query($showquery); if (!$showtypedata) // connection failed; show error and exit { echo ("Show type query error:".$u_showtype."<br />".$showtypequery."<br />\n"); include('sources/dberror.php'); } When $u_showtype = 1, $showtypequery = "SELECT * FROM ShowType WHERE StypeID = '1' When I run this query under phpMyAdmin, it executes perfectly. When I execute it within the program, I get the error, which is "Query Is Empty". It should return 1 record. What am I doing wrong?
-
Is there a way to have a fixed-sized background image used to fill 100% of the area that it is the background? I have tabs that emulate folder tabs in a file cabinet, with a background image for the tabs for the rounded corner effect, and a different color for the tab that is selected for the page view. The tab row has a fixed height, but the tabs could have a different width based on the text for that tab. My image is 80px by 30px, with the 30px being the fixed height. The width can range from 50px to 125px. I guess what I am looking for is an equivalent to the 'stretch' option that is available for your desktop background in Windows.
-
Is there a way in PHP to be able to detect the media type of the user? I want to be able to detect if the user is using a handheld device (cell phone browser or smartphone) and do one of two things: have different code for handheld that uses less bandwidth; redirect to a different page.
-
I need to create a horizontal navigation bar, but I am not sure of the best method to do this easily. Naturally, the top level is 'home'. The first level will be specified by a uniform variable passed by $_GET. (i.e. index.php?act=dothis). The second level will be based on what the first level, so the key passed may be different. For example, since this is for a music site, index.php?act=lyrics&song=mysong would be a song lyric page, and navigate Home > Lyrics > Song Name index.php?act=concert&show=showdate would give concert information Home > Concert > Concert Does anyone know of any guides that could help me with this? Thanks.
-
Yes it is for data, not layout.
-
I want to center a TABLE on my page with CSS, and have the same effect as the following code: <center> <table> ..... </table> </center> Setting style='text-align: center' does not work, as it centers all of the text within the table, not the table itself. Thank you for your suggestions.
-
I am in the process of converting a static-design website to a dynamic one. The static site has over 400 pages of content, and has grown past the point of being able to manage it properly. The conversion to a dynamic site should change this, making my life somewhat easier. My concern is this: How do I deal with those 400+ pages being indexed on search engines without losing my page rankings in the conversion process? Even if I implement a 'friendly-url' type of handler in my code, the result still will not be the same as the previous static url. Thanks for your suggestions.
-
That works! Thank you.
-
$update_query = "SELECT * FROM Updated ORDER BY Update DESC LIMIT 1"; $update_data = mysql_query($update_query) or die("Error in accessing database: Update"); without the single quotes around 'Update' I get an SQL error
-
I have a timestamp table in my database, which gets a new record added at certain modification times. the timestamp is the only field in the table, and is the primary key. I have tried the query: "SELECT * FROM Updated ORDER BY 'Update' DESC LIMIT 1" which would (in my mind) return the highest (or most current) timestamp. Unfortunately, it does not, and just returns the first record in the table. Adding or removing the 'DESC' does not change this; neither does removing the 'LIMIT 1'. Not sure what I am doing wrong.
-
Double check that all of your curley braces {} match up. Missing a closing brace is an easy way to get the 'unexpected $end' error
-
[SOLVED] Checkbox not being passed to database
rkstevens replied to rkstevens's topic in PHP Coding Help
Got it working. Thanks for all of your help. I'll probably have more issues later as I convert a 100% static site into a dynamic one. -
[SOLVED] Checkbox not being passed to database
rkstevens replied to rkstevens's topic in PHP Coding Help
So I would have to add something like this before I INSERT? $isAudioClip = 0; if ($_POST[AudioClip]=='on') { $isAudioClip = 1; } -
[SOLVED] Checkbox not being passed to database
rkstevens replied to rkstevens's topic in PHP Coding Help
Form: <form action='processsonginfo.php' method='post'> <table> <tr> <td>Song Title</td> <td><input type="text" name="SongName" size="40" /></td> </tr> <tr> <td>Song Author</td> <td><input type="text" name="SongAuthor" size="40" /></td></tr> <tr><td>Song Copyright</td> <td><input type="text" name="SongCopyright" size="40" /></td></tr> <tr><td>Footnote</td> <td><input type="text" name="AlbumFootnote" size="40" /></td></tr> <tr><td>About the Song Title</td> <td><input type="text" name="AboutSongTitle" size="40" /></td></tr> <tr><td>About the Song Text</td> <td><textarea name="AboutSongText" rows="8" cols="40"></textarea></td></tr> <tr><td>Lyrics for song?</td> <td><input type="checkbox" name="SongLyrics" checked="checked" /></td></tr> <tr><td>Audio clip for song?</td> <td><input type="checkbox" name="AudioClip" checked="checked" /></td></tr> </table> <center> <input type="submit" /> </center> </form> Query in processsonginfo.php: $doquery = mysql_query( "INSERT INTO Songs (SongID,SongName,Songurl,SongAuthor,SongCopyright,SongLyrics,AboutSongTitle,AboutSongText,AudioClip,AlternateLyrics,AlbumFootnote) VALUES ( '' , '$_POST[songName] , 'trimAll($_POST[songName]' , '$_POST[songAuthor]' , '$_POST[songCopyright]' , '$_POST[songLyrics] , '$_POST[AboutSongTitle]' , '$_POST[AboutSongText]' , '$_POST[AudioClip]' , '' , ''); -
[SOLVED] Checkbox not being passed to database
rkstevens replied to rkstevens's topic in PHP Coding Help
change did not do anything. Still get a '0' stored in database no matter if checked or not -
I have the following line in my form: <input type="checkbox" name="AudioClip" checked="checked" /> but when I send this to the database INSERT INTO Songs (... , AudioClip , ...) VALUES (... , '$_POST[AudioClip]' , ...) the value inserted into the AudioClip field in the database is 0, if the checkbox is checked or not checked. AudioClip in my database is BOOL type [TINYINT(1)] Thank you for your assistance. Ron