- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 6
- Posts with Upvotes
- 6
- Upvoting Members
- 5
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- PC Specs
- Windows XP, Vista
61 Posted Topics
I would like to capture the modification date from a log file on the client machine in order to warn users (technical on an internal website) that they have not run updates for a given subsystem. Is there a way to do this? I've done this sort of thing before, … | |
I'm converting some old work to mysqli, and having a bit of trouble with Prepared Statements. In the stripped down code sample below, I'm able to confirm that the code below pulls the records; line 8 echoes the string as expected and if I replace the id parameter with something … ![]() | |
I'm converting old MySQL code to MySQLi, and running into some questions. When selecting data from the database, is it necessary or strongly advised to use prepared statements, or can I safely escape my user-derived parameters like the sample below? In a perfect world I'd have all the time I … | |
Sorry in advance if this is the wrong place for this, it's the closest I could find. I need to create a macro for an Excel 2010 spreadsheet so that the active cell will cycle through three choices: "Y", "N" or "" - the last being simply an empty string … | |
I have a table that shows tabular data across 7-8 columns, which works very well on a standard monitor. However, on a smartphone or even a tablet, it's a little less functional. Is there a way to automatically condense the data into fewer columns when the page is being view … | |
I have a lab management webapp that lists servers on my network. With a click in IE I can open a terminal services session to that server. The code - shown below - works in IE, but not in chrome or firefox. Can anyone suggest how I can make this … ![]() | |
I have a series of user records in the form "`Lname, Fname (ABCD)`" where `ABCD` is the division the user works in. I need to be able to extract that substring so I can sort on it, count etc to I can see what divisions are using resources. In MySQL … | |
Re: Still drives me nuts that the title bar is gone. | |
I have a form to edit a table record, and am having trouble with it in Chrome. In IE7 it works fine, in Chrome it does nothing. It uses javascript because there is a sprite to change the button on hover. Any ideas? I'm stumped and would appreciate any help … | |
Re: Line 1 suggests you are using shorttags, which can easily break a site if you move servers. It may be that this has nothing at all to do with the database. Replace <? with <?php and see if that helps. May take some hunting to do it, but worthwhile. I … | |
I'm dipping my toe in the water of salted passwords by upgrading an older webapp, and would like to present the rough outline of how my system would work in the hope that those with more experience than I might tell me if I'm going in the right direction; In … ![]() | |
I'm new to MSSQL though I have some grounding in MySQL. At the moment, I'm trying to use a variable. Reduced to simpler form, my query to search people with 'and' in their name is: DECLARE @MyVar nchar; SET @MyVar = '%and%'; SELECT name,email FROM db.dbo.users WHERE name LIKE @MyVar; … | |
My users arrive on the page, optionally with a query string. The query string data - if present - goes into a textarea element in a form, where it may be edited, then POSTed back to the page with the submit button. Now I have a bit of a mess … | |
Re: Sounds more like you have a characterset problem. If everything along the line is using Unicode, including the database. I don't have a lot of experience with this sort of issue, but I would think that current databases and browsers should have no problem with this. I'd try echoing things … | |
Re: Possibly PHP is configured differently or is a different version on the two websites. In any case, that "Can not modify headers information - header already sent" stuff is very sensitive. Even a blank line in your source can result in a single carriage return being sent to the browser, … | |
I have a configuration table with one row per configuration item (id,category,name,value,description,comment). My objective is to create a single edit page that shows all, or a subset, of these values and allows me to edit them. I could probably create a page with a separate form and submit button for … | |
Re: Assembling a query dynamically can be unpredictable. When I have problems like this I usually introduce a new line to assemble the SQL statement in a variable, then print the variable to screen to let me see what I'm sending to the db server. $sql = "SELECT $myval1,".function('foo').",myval2 FROM mytable;"; … | |
Re: The first thing to to when you're having display or behaviour problems on a site it to validate your code. I usually put a link like the one below at the bottom of every page on my site. The middot part means that all that will show on your site … | |
I'm new to triggers, but have been working with MySQL for quite a while. Now I need to implement a trigger. I want to create a trigger on my 'persons' table so that after an update, ***if the attribute clubid is changed***, attribute clubname should be changed. I have a … | |
I have a lab management webapp that lists servers on my network. With a click in IE I can open a terminal services session to that server. The code works in IE, but not in chrome or firefox. Can anyone suggest how I can make this work in Chrome (Firefox … | |
Re: The exclamation point indicates a negative, [B]continue[/B] breaks you out of the FOR loop, and [B]$row = mysql_fetch_assoc($result)[/B] reads another row from the dataset you're processing with the FOR loop. So if I'm not misreading it, the code I've copied below is saying: - read the next row from the … | |
Re: This may help. I sometimes use this in a WHILE loop, processed for each row of a result set. It's perhaps slightly less efficient, but can make code easier to read when I use the variables. With this code [B]$row['name'][/B] becomes [B]$name[/B], and so on for each attribute in the … | |
Working in Word 2010, I have a long document with many formatting changes to be made. To start with, throughout the document I'd like to replace "Click OK" with "Click [B]OK[/B]", so the OK will be bold but not "Click". I also need it to be case insensitive, as some … | |
Re: I don't mean to sound discouraging, but what you're talking about sounds like a massive undertaking. Established travel companies with teams of experienced programmers spend years and probably hundreds of thousands of dollars to do this sort of thing. I doubt that you could do all these things in Joomla. … | |
Re: By far the easiest and fastest way to do this would be by installing WAMP Server for a Windows machine. This installs Apache Web Server, PHP and MySQL and configures most settings for you. I used to do this the hard way, no more. WAMPServer is the way to go. … | |
I'm trying to create a Google-style bar across the top of my page, but when I hover over the elements, the link text jumps to the top. Can anyone tell me how to keep it on the bottom? My current code is below. [CODE]<html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" … | |
I'm trying to create a WordPress.com header for rotary7040pr.wordpress.com. I have a layer for the background colour, and have created another layer for text and graphics. So far so good. Now I have a graphic ([url]http://www.rotary7040.com/images/RotaryLogoDropShadow300x288.jpg[/url]) that I want to place on the layer with the text, but I don't … | |
Re: I always keep my connect string in a separate include file so it is used universally. I can use it in hundreds of scripts, but only need to modify it in one place. Ultimately it has to be there in clear text. Would be interested if the Security gurus have … | |
Re: Without having a chance to run the code, here are my impressions. The line [ICODE]$j=0;[/ICODE] should be above the for loop - as it is it will never move past the first element of the array because it is reset to zero at the start of each iteration of the … ![]() | |
Re: Perhaps a cron job could be set by your administrators, under their higher privileged account, to change the execution and memory limits, run your job, then change the execution and memory limits back. Might that work? | |
Re: Dandello is absolutely right about the validator. A code validator like [url]http://validator.w3.org/[/url] should be the first stop when troubleshooting a problem. There's no sense troubleshooting a problem sitting on top of shaky code, and surprisingly often the problem disappears when the code is validated. | |
Re: Just keep in mind that if you annoy your hosting company, it could come back and bite you in a big way. Most ISPs host mail for many clients on a server. Event the suggestion of spamming can get an IP blacklisted, and if that happens it takes out mail … | |
I need to create a form validation system where the user will be returned to the form with the valid data still in the form and the bad data barked for correction. Can anyone point me to a good tutorial for that sort of thing? | |
Re: I don't want to discourage you, but what you're asking is far more involved than any forum post can cover. You can't even begin to think about creating a login system and a shopping card system youself until you've become very comfortable with basic to intermediate PHP and MySQL. You … | |
Re: You can actually do this with a single line of code: [CODE=php]// mysql_result() function is used to pull a single value from the database $value = mysql_result(mysql_query("SELECT value FROM table WHERE condition = 'met'"), 0);[/CODE] | |
Re: I have had success storing values in cookies. This was particularly useful when I had to transfer values between JavaScript and PHP. Here is the code I wrote at the time. The context was that latitude and longitude values were being modified in a Google Maps application, and I wanted … | |
I have a gradient header image as a background image in a header div. The gradient, which stretches horizontally across the entire page, has three distinct vertical partitions of 32, 72 and 56px, and I'll ultimately want to apply top and bottom padding to one or more if the three … | |
Re: Never, ever store information in a database that can be easily calculated from other data in the database. Any time you store the same information in two places, which in a sense is what you're doing here, you introduce the possibility of an error, and unnecessarily complicate your database. What … | |
Re: I think we'd need more information on just what it is you're trying to do, and clarification on your second sentence, in order to help. | |
Re: I'm afraid you've lost me here. `mysql_num_rows()` will return an integer. I'm not sure how or why you would sort by an integer. Unless this is some tricky SQL syntax I've never heard of, you can only order by a field name (or alias), not by an integer. BTW, it's … | |
Re: Hi David; First let me gently suggest that the run-on sentences in your post make it hard to identify your problem. Clarity is critical when trying to explain what you need. Also, your code needs to be in [iCODE][code=php][/iCODE] tags so we can read it clearly and respond quoting line … | |
Re: Hand coded PHP and CMSs each have their merits. For a fairly static site like yours hand-coded PHP might be the answere. You probably don't want non-tech people in the code though. Consider having the supervisor update the data with a spreadsheet, then put a macro in the spreadsheed to … | |
Re: Given the link you show, you are passing the string [iCODE]music.mp3[/iCODE] in the query string as the value of 'id'. At lines 12 and 42 you have [iCODE]http://www.mydomain.com/<?php echo $mURL; ?>[/iCODE], so what you are going to get is [iCODE]http://www.mydomain.com/music.mp3[/iCODE]. I think you have two problems. First, you mean to … ![]() | |
Re: [QUOTE=SoN9ne;933679]That's debatable. I use foreach on $_POST/$_GET but i use a white list to prevent injection. clever works as long as you cover all angles. Saying, "Clever may be fun but it's usually not the correct solution." is just plain wrong. Usually clever works, sometimes it can backfire. The foreach … | |
This code does a nice job reading the members from my database and setting up a form with checkboxes for each member in one long single-column list. What I need to do is to write some sort of loop that sets out 3 or 4 columns and splits the names … | |
Re: Keep in mind that you don't need to use AJAX for this. You could have your drop list trigger a javascript to reload the page pulling up the checked status relevant to the project selected in the droplist. AJAX might be the best solution, but it's not necessarily the best … | |
Re: On line 12 [iCODE]FROM "vtp_urls" WHERE[/iCODE] needs to be single quotes. That should do it. Whenever you get that "unexpected T_STRING..." error, look for a problem with quotes. Your whole SQL query is surrounded by double quotes, so any quotes within that query must be single quotes or escaped , … | |
Re: I have, unfortunately, no experience with OOP, and can't make sense of OOP code, but this sounds like a scope issue to me. You've established that the master.php code is being referenced. That would have been my first piece of advice. How about if you put your echo test statement … | |
Re: I would think this is a SQL query issue. I learned the hard way to put 'lastvisit' and 'lastlogon' attributes in my all user tables. On top of that, I often put 'lastmodified' attributes in my entity tables like the posts table. So you logic would be something like this; … |
The End.