|
-
javascript click tracker
Date: 05/18/05
(Web Development) Keywords: php, mysql, browser, html, sql, java, tracker
I'm trying to create a javascript click tracker, but I'm having a problem. The setup is very simple so I'll just give the code.
index.html
---------------
A Link
tracker.php simply inserts the url of the link into mysql.
The problem is very strange. Everything works fine if the files served
from my local machine. If I upload it to the server things get weird.
It doesn't work with firefox from my office (3 different machines and 3
different versions), but it works with firefox from every other place
(home, friends, etc). It works fine with IE and Konqueror. Note: I
did change localhost in the js function to the proper value for the
server. It works if I go directly to the URL that's in the javascript
so it seems that that line isn't exucted by my local firefox browsers.
Does anyone have an ideas on this? Is there a free click tracker script
that any of you know of? (free as in I can see the code)
Source: http://www.livejournal.com/community/webdev/200619.html
-
Help with Date fields on a form
Date: 05/18/05
(PHP Community) Keywords: mysql, database, sql, web, google
This is driving me nuts.
I've got about a dozen different forms on my website that all have a date field of some sort, whether it be news date, dob, etc. All of them are used to insert data into a mysql table. I've got the corresponding fields in the table set as "DATE" fields. But I'm having issues getting the date to convert properly.
Since the format of a mysql date field is YYYY-MM-DD, I have to do some converting in cases where I need to retrieve the date from the table. For example, if I'm showing somebody's date of birth, I pull the info from the table and then use date() to convert the date to MM-DD-YYYY. As in $dob = date("m-d-Y", strtotime($dob)); where $dob is the date pulled from the table.
The problem is changing that date and updating the table. When stuffing the date back into the table, I've gotta convert it back to YYYY-MM-DD, so then I use $dob = date("Y-m-d", strtotime($_POST["dob"]));
Works fine unless the date is entered on the form with / instead of - as a separator. So what this leads me to discover is that on forms where the user enters the date, they could enter it any number of ways. Even if I specify that they use dashes instead of slashes, there's no way to guarantee that they will. That means that my date in the table will only be correct some of the time.
So what can I do to the date fields on all of my forms to ensure that no matter how the user enters the date, it will be converted properly to YYYY-MM-DD and stuffed into the table?
The best answer I could find on google was using dropdowns for month, day and year. That would be fine on forms where the date is being entered for the first time. But it would be a huge pain to implement on "edit" forms where the fields are populated from the database when the form loads.
I'm about to start pulling my hair out here, so hopefully somebody has a good idea. I'm open to nearly any suggestion.
Source: http://www.livejournal.com/community/php/299442.html
-
laptop and SQL questions
Date: 05/18/05
(IT Professionals) Keywords: programming, software, database, sql, web
Howdy all,
After 6 years in the trenches of application and network support I am calling it quits and returning to academia in social science. That is not to say that my IT days are entirely behind me. My area of research is going to be heavily reliant on Geographical Information systems and database design and analysis...
so I have a few questions for the group
1. (this one is an easy one probably).. I am looking to purchase a laptop in the next few weeks. I am torn between going with a tablet (the toshiba, I have seen far to many problems with some of the others , especially the acer) and a cheaper basic laptop. Essentially I am not all that concerned with performance if I go cheap. The first couple of years it just needs to run word processing, statistical analysis software, GIS software (on a low level) and that sort of thing. If I go cheap I would buy another one when i started the dissertation.. The question is on the reliability of the toshiba tablet.. have any of you used it extensively, or deployed them? I just want to be sure it is gonna hold up if I am gonna spend a nice chunk o change on it.. if the view is negative, whose laptops do you like? No way in hell I am getting a sony, but is there anyone else i should avoid like the plague?
2. For the SQL folks out there. It looks like the department uses MS SQL(I will have to stick with it for awhile because all the GIS programming courses are VB and i really won't have time to learn a real programming language). My question is, when I go to build my own SQL box what sort of spec should i be looking at? My databases will be the platform for my GIS mapping, and will be essentially legal databases with a relatively small amount of data (case name and number, disposition, appellate action, votes on appellate action and brief case summaries) Eventually it will all be set up with a read only web interface for sharing the data. How beefy am I going to need to go. I know MS SQL is a resource beast, so I probably can't get away with having it on a machine that does much else, but I am going to be on a grad student budget, so unless I get some major funding I will need to stay reasonably cheap
Input greatly appreciated!
Source: http://www.livejournal.com/community/itprofessionals/11926.html
-
Access database and ASP
Date: 05/18/05
(Web Development) Keywords: php, database, asp, sql, web
I have an access database I'd like to put on the web, so:
1) Is the best way to do this using ASP? Currently the website is hosted on Dreamhost, which I don't think supports ASP. Is there maybe an easy way to export it to an SQL database and then use PHP?
2) If the best solution is ASP (which I've never touched), can you recommend any good hosts?
Thanks.
Source: http://www.livejournal.com/community/webdev/201019.html
-
Goofy permissions
Date: 05/19/05
(MySQL Communtiy) Keywords: php, mysql, sql
I have a PHP script that was failing until I fixed the permissions. It was falling down on DELETE. The script's account in the mysql.user table had Delete_priv set to N. When it was changed to Y, the script ran.
However, Select_priv, Insert_priv, and Update_priv are also set to N, and the script has not had any problems running SELECT, INSERT and UPDATE queries. Why would this be happening?
Source: http://www.livejournal.com/community/mysql/57244.html
-
Crikey is LAMP ever fast...
Date: 05/19/05
(PHP Community) Keywords: cms, php, templates, mysql, sql, linux, apache
I don't know why I never thought to do it before, but I put some benchmarking code into my CMS project today (PluggedOut CMS) - and was somewhat astounded at how quickly it's throwing pages back at me.
For an "un-cached" page, it's throwing things back in around 0.004 seconds, which I thought was damn fast... but get this - if I cache the page (so it doesn't have to bother building it from templates etc...) - it took just under 0.0004 seconds on average.
I don't know of a better advert for Linux, Apache, MySQL, and PHP quite frankly.
For those interested, the testing is on a Athlon 64 3200 (2.8Ghz), with 1Gb RAM, and a 160Gb HDD. It has Mandrake X64 on it.
Source: http://www.livejournal.com/community/php/299782.html
-
MySQL -> MS SQL SQL Create Script
Date: 05/19/05
(Web Development) Keywords: mysql, sql, web
Hello everyone,
We've got a MySQL DB on a solaris box that is going to be retired shortly and we need to move the data source for a web application from MySQL to MS SQL. I dont't work with MySQL as much, so I would like to know if anyone can tell me how to get a SQL create script out of the MySQL db so that I can recreate it in MS SQL.
peace.
Source: http://www.livejournal.com/community/webdev/201858.html
-
LEFT function ntext data type
Date: 05/20/05
(SQL Server) Keywords: sql
Hello everyone,
I know that you cannot do the following if columnName is ntext datatype:
SELECT LEFT(columnName, 400)
Is there another way to achieve the same effect in the SQL query itself?
Source: http://www.livejournal.com/community/sqlserver/27272.html
-
MySQL -> MS SQL SQL Create Script
Date: 05/19/05
(SQL Server) Keywords: mysql, sql, web
Hello everyone,
We've got a MySQL DB on a solaris box that is going to be retired shortly and we need to move the data source for a web application from MySQL to MS SQL. I dont't work with MySQL as much, so I would like to know if anyone can tell me how to get a SQL create script out of the MySQL db so that I can recreate it in MS SQL.
peace.
Source: http://www.livejournal.com/community/sqlserver/26975.html
-
LEFT function ntext data type
Date: 05/20/05
(Asp Dot Net) Keywords: sql
Hello everyone,
I know that you cannot do the following if columnName is ntext datatype:
SELECT LEFT(columnName, 400)
Is there another way to achieve the same effect in the SQL query itself?
Source: http://www.livejournal.com/community/aspdotnet/34515.html
-
Selecting all records between dates
Date: 05/23/05
(MySQL Communtiy) Keywords: php, mysql, database, sql
Hello! This is probably a painfully stupid question, but I'm asking anyway. I'm trying to select all records in the database where the start date (start, which is of type date, obviously) is between the user-supplied dates.
Entering select email from nexus where start between '2000-01-01' and '2005-05-01'; from the mysql prompt returns the correct information, but when I put it in a php script, it returns nothing. I've got other queries in this same script ("select email from nexus where ".$field." like '%".$term."%'") which are working as expected, so I'm pretty sure it's just that particular query.
It's probably something really stupid that I just don't see because I'm looking too hard, but I'm all out of ideas. If any of you kind folks have any insight, I'd really appreciate it. Thanks!
Source: http://www.livejournal.com/community/mysql/57350.html
-
PHP + MySQL Paging
Date: 05/23/05
(WebDesign) Keywords: php, mysql, sql, google
Well, it turns out this whole PHP and MySQL project was a heck of a lot easier than I thought.
I have hit one hitch, though. I've looked all over Google for an easy script for using paging with my SQL queries. When all is said and done, this table I'm going to have will have somewhere around 5,000 entries, so I really need to enable paging.
Problem is, all the scripts I've found won't work.
I'm using a somewhat complex SQL statement (it's not just a SELECT * FROM TABLE kind of thing), and I've got all my query display and search functions working correctly. I just need this paging thing to work. I understand the general idea of how the whole function is supposed to work, but I keep getting errors.
If anyone can give me any help at all, I'd really appreciate it. I've totally resorted to cut-and-pasting code and just modifying the SQL statement to work with my existing tables, but it still won't work. I can post code portions if necessary..
Thanks in advance.
Source: http://www.livejournal.com/community/webdesign/887367.html
-
Digital Download
Date: 05/26/05
(WebDesign) Keywords: php, mysql, sql
I've been asked to make a site capable of handling sales of digital material, downloadable immediately on payment. It has to be able to handle packages sold as one product that are more than one file. (I've also seen some advertising that they can integrate login systems with, say, phpBB, which would be a nice (though not necessary) addition.)
There are dozens (if not scores) of code bundles out there to do this - but most of them cost, and I have no idea which ones are most effective. Can anyone recommend one they've worked with that is particularly good (and preferably not too expensive)? (PHP/MySQL preferred.)
Thanks!
Source: http://www.livejournal.com/community/webdesign/889152.html
-
PHP help!
Date: 05/27/05
(Web Development) Keywords: php, mysql, database, sql, web
I'm working away at this PHP + MySQL stuff...
Now I have two tables - links and linkcats. Links is a list of links that will be displayed on the Employee Resources page. Linkcats is a list of the categories under which these links will fall - Intranet Websites, Internet Websites, and Employee Resources. I would like to be able to dynamically display the link categories with the appropriate links from the links table under each category. I got it to work (kind of), but it loops through the SQL statement to display the actual links however many entries there are in the categories table.
You can see what I'm talking about here: http://www.shifuimam.com/php_tutorials/database_trial/www/mclinks.php
This is my code, along with the descriptions of the two tables: http://mypage.iu.edu/~cstrodtb/livejournal/mclinks.txt
Any help is appreciated.
x-posted to webdesign.
Source: http://www.livejournal.com/community/webdev/204666.html
-
More PHP help. :\
Date: 05/27/05
(WebDesign) Keywords: php, mysql, database, sql, web
I'm working away at this PHP + MySQL stuff...
Now I have two tables - links and linkcats. Links is a list of links that will be displayed on the Employee Resources page. Linkcats is a list of the categories under which these links will fall - Intranet Websites, Internet Websites, and Employee Resources. I would like to be able to dynamically display the link categories with the appropriate links from the links table under each category. I got it to work (kind of), but it loops through the SQL statement to display the actual links however many entries there are in the categories table.
You can see what I'm talking about here: http://www.shifuimam.com/php_tutorials/database_trial/www/mclinks.php
This is my code, along with the descriptions of the two tables: http://mypage.iu.edu/~cstrodtb/livejournal/mclinks.txt
Any help is appreciated.
Source: http://www.livejournal.com/community/webdesign/890460.html
-
Help
Date: 05/31/05
(PHP Community) Keywords: php, mysql, sql
This script always comes out with a Parse error on line 40, and I dont know what to do
I don't see any syntax errors, and I'm completely new to PHP and MySQL.
// This script adds guestbook entries to the database.
// Address error handling. ini_set ('display_errors', 1);
if (isset ($_POST['submit'])) {if ($db_connect ('localhost', 'name', 'password'){
if (!@mysql_select_db ('name')) die (' Could not select the database because: ' . mysql_error() . ' '); }
} else { die (' Could not connect to MySQL because: ' . mysql_error() . ' '); }
// Define the query. $query = "INSERT INTO guest_entries (blog_id, name, email, aim, url, location, comments, date) VALUES (0, '{$_POST['name']}', '{$_POST['email']}', '{$_POST['aim']}', '{$_POST['url']}', '{$_POST['location']}', '{$_POST['comments']}', NOW())";
// Execute the query. if (@mysql_query ($query)) { print ' Thank you "$_POST('name')" for signing my guestbook. '; } else { print "ERROR
Could not submit guestbook entry because: " . $mysql_error . "." }
mysql_close();
?>
|
What could be wrong here?
To my knowledge, I'm running MySQL 3.23.56, but I'm not sure. I'm on the 100webspace server.
Source: http://www.livejournal.com/community/php/302360.html
-
Hey..
Date: 06/03/05
(SQL Server) Keywords: cms, database, sql, web, seo, microsoft
Hey everybody. I hope there are some smart database people out there to make up for my lack of knowledge.
Anyway, I have a (hopefully) rather simple question.
I work at the local university maintaining the webpage for the nursing program here. The ladys I work for are not very computer smart, so I'm trying to develop an easier way for them to upload new data to class pages, new homework assignments, new lecture slides, etc etc etc. Basically a kind of micro-cms system.
Yes, I'm reinventing the wheel, but I feel it will be a good experience for me.
Well, I'm using .NET for this (C#) because of what's available here at school, and while in the end, everything will be on the SQL Server, for development purposes the webmaster for the school has said that I need to use MS Access.
Blech. Hopefully I won't have to change a whole lot of stuff for the migration to happen, but for now I'm stuck.
Unfortunately, while I can figure out the Queries and the basic commands, actually connecting to a MS Access database is proving to be rather difficult for me. I cannot seem to find an authoratative guide on what all I need to put to create the connect.
Most of the functions are going to be located in a seperate file, and once its all compiled, it should (hopefully) work. But I cannot seem to find what the connect string is.
In my databaseConnect() function I have this:
void databaseConnect() { String connectionString = "Provider=Microsoft.Jet.Oledb.4.0;"; connectionString += "Data Source=I:/web/nursing/dev/resources/exams/nursingExams.mdb;"; createUpdateExamConnection = new OleDbConnection (connectionString); databaseOpen(); } //end databaseConnect
For some reason, this just doesn't seem to work.
I've imported the correct thing, as far as I can tell...
using System.Data.OleDb;
But I'm stuck.
Any info that you guys can give me would be appreciated.
Thanks so much!
Source: http://www.livejournal.com/community/sqlserver/27485.html
-
UTF encoding help
Date: 06/05/05
(MySQL Communtiy) Keywords: php, mysql, sql
I'm hoping someone here can help me out, as I have a problem that is driving me crazy. I'm trying to get mysql to store and retrieve various bits of text in various languages, however, it's not entirely co-operating. As an example, I've stored part of the Russian alphabet (А Б В Г Д Е Ж З И Й К Л М Н О П) and I'm trying to retrieve it via a perl CGI script. I'm using PHPMyAdmin to store the strings, and it seems to think everything is fine - if I do a select on that record, it displays it properly, however if I try and display it using Perl, I get "? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?". I thought initially that it was a perl encoding thing - I've made sure that the content-type is set to utf-8 in both the HTTP header and the meta tag, but it seems to make no difference. I've also tried running it through the terminal as well as using a utf8-decode function, but I get the same result regardless. I'm beginning to wonder if it is mysql behaving oddly, though, as if I log into mysql through the terminal and select this record, I get "? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?" there as well - though for all I know, this could just mean that my terminal can't display Russian / UTF-8 characters! Does anyone have any ideas about how I can fix this or even if it's likely to be MySQL that's causing these issues or Perl?
Source: http://www.livejournal.com/community/mysql/58443.html
-
help with mysql functions...
Date: 06/05/05
(PHP Community) Keywords: mysql, sql
...Using if (mysql_db_query ($DBName, $Query, $Link))
(Yes, I know its depreciated)
Problem: my query has two conditions x='$x' AND y='$y'
if either x or y is incorrect (but one is right), mysql_error() does not return an error. I assume its returning "TRUE".
My question: How do I detect "TRUE" but ""?
if (mysql_db_query ($DBName, $Query, $Link)) does not seem to be what I need.
Source: http://www.livejournal.com/community/php/304716.html
-
ALTER TABLE
Date: 06/06/05
(MySQL Communtiy) Keywords: mysql, sql
mysql> ALTER TABLE a CHANGE id id1 int(11); ERROR 1171: All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead Column "id" is PRIMARY KEY, AUTOINCREMENT. How can I rename it?
Source: http://www.livejournal.com/community/mysql/58653.html
|