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?
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?
Here's what I have Apache 1.3.33 PHP 5.0.4 MySQL 4.1.12a Operating System: Windows 98
The error that I got when I tried using mysql_connect() on a php page:
Fatal error: Call to undefined function mysql_connect()
Things that I have done so far: Apache, mySQL, and PHP are in directories on the C drive, named accordingly
in php.ini, this is what I changed (change in italics) doc_root = "C:\Apache\htdocs" extension_dir "C:\php\ext"
Removed the ";" in front of extension = php_mysql.dll (Is there supposed to be quotation marks on this line?)
Saved a copy of php.ini (after these changes) in the C:\Windows directory Saved copies of c:\php\libmysql.dll & c:\php\ext\php_mysql.dll to the C:\Windows directory
Here's what I have Apache 1.3.33 PHP 5.0.4 MySQL 4.1.12a Operating System: Windows 98
The error that I got when I tried using mysql_connect() on a php page:
Fatal error: Call to undefined function mysql_connect()
Things that I have done so far: Apache, mySQL, and PHP are in directories on the C drive, named accordingly
in php.ini, this is what I changed (change in italics) doc_root = "C:\Apache\htdocs" extension_dir "C:\php\ext"
Removed the ";" in front of extension = php_mysql.dll (Is there supposed to be quotation marks on this line?)
Saved a copy of php.ini (after these changes) in the C:\Windows directory Saved copies of c:\php\libmysql.dll & c:\php\ext\php_mysql.dll to the C:\Windows directory
I have two tables. They both use the same user ids. I need to compare the tables and get all the rows in table A that aren't in table B. I suspect I need a JOIN. I have read the MYSQL.com stuff on joining, and I've tried to find other tutorials on this, but I'm not having much luck finding something that addresses the issue. If you have advice, links or at least good Google search terms, I'd be most appreciative.
Hello all, I'm new to the list, and I want to jump right in and ask a stupid question: is there any way for me to set things up so I see user passwords unencrypted when I log in as root? I looked around on the mysql website but couldn't find any information. Any ideas?
Okay, I'm having a bit of a problem here... I'm trying to create an RSS feed from my MySQL database. Unfortunately though, I can't seem to write to a file. PHP isn't running in safe mode, and the enclosing folder permissions don't seem to make a difference. The file gets created, but no writing occurs, and if the 'is_writeable' statement is taken out, the script runs until it times out and gives an error 500. Anyone have any clues?
error_reporting(1);
include("sqlstuff.inc");
$filepointer = fopen("/kunden/homepages/28/d58558265/htdocs/rss/news.rss", "w+") or die ("can't open file");
my exams finished today and i intend to learn PHP for my websites. i've been dying to for such a long time but i have a question. i really don't get this MySQL business- installing it on what? my computer? i have a Mac (PowerBook G4) .. so is it compatible?
it's possible to do PHP in DreamWeaver right? also, if anyone wants to point me in the direction of any easy PHP tutorials... feel free XD
I've been wrestling with this query all afternoon. I've read the MySQL docs and got some help from the PHP LJ group, but now I'm totally stuck.
I have this query:
SELECT nuke_project_milestones.start_date,
nuke_project_milestones.length_num,
nuke_project_milestones.length_type,
date_add(nuke_project_milestones.start_date, INTERVAL nuke_project_milestones.length_num nuke_project_milestones.length_type)
AS estfinish FROM nuke_project_milestones
To my mostly untrained eyes, it looks okay, but when I run it, I get this error:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'nuke_project_milestones.length_type) AS estfinish FROM nuke_pro
Poking and prodding around leads me to believe it has something to do with the length_type variable, which is a 5-character varchar, which I set through my PHP script to be DAY, MONTH, or YEAR.
So, in short, what am I doing wrong? (With this query, anyway.)
I've tried looking in PHP and MySQL docs for this, and just regular google searches, and I'm coming up nil. (Despite being fairly sure I found this the other day.)
I have a date (YYYY-MM-DD), a length, and a length type (day, month, or year). I want to add the length to the date to get a new date. How do I do this?
*staples a note that says "Bookmark" to her forehead
Hello, I’m a second year Computer Science student at Cal Poly, SLO. With no open source or real world experience however I'm really eager to get involved in the open source community and start help developing software. Does any one have any suggestions for a newb. I would like to work on development of web applications preferably using PHP, MySQL, XML and using Asynchronous JavaScript and XML (Ajax). However I am a beginner in all of these languages.
- What would be some good starting points for me? (Communities, progjects, work) - Being that I'm a beginner how do I go about finding simple tasks/projects to start out with? - Live Journal looks interesting to me but I have my heart set on learning PHP not perl. Is this dumb? Should I not be focused on the language but rather the project?
Thanks in advance for any advice you have for a newb.
Our company's website was recently rebuilt from a collection of many HTML pages assembled over several years to a new mysql-based site. We used to have a large collection of numbered files in a directory called specs, so the url was site.com/specs/6413.htm, for instance. Now it needs to be site.com/display_page.php?p=200&s=6413.
Is there a way I'm unaware of to have it direct misdirected viewers to the correct page? I have access to the 404 page, but I'm unable to rename it from it's default .html and create a dynamic page. Any ideas?
Hi everyone this is my first post and my first Python script.
The script will take a URL as input. The URL will look something like this.
thevenuslist.com/show_image.py/55.jpg
The script will then take the 55 and use it to retrieve binary data for an image from a database. Then image headers will be sent to the browser followed by the binary information.
I think I am having a problem with the headers. When I run the script from command line I get the headers and then a bunch of goo which is the binary information but when I run it from the browser I get an error.
#!/usr/bin/python
import MySQLdb, cgi, string, os
def getScriptname():
""" Return the scriptname part of the URL. """
return os.environ.get('SCRIPT_NAME', '')
def getPathinfo():
""" Return the remainparth of the URL. """
pathinfo = os.environ.get('PATH_INFO' '')
# fix fr a well known bug in IIS/4.0
if os.name == 'nt':
scriptname = getScriptName()
if string.find(pathinfo, scriptname) == 0:
pathinfo = pathinfo[len(scriptname):]
return pathinfo
def getData(idNumber):
Con = MySQLdb.connect(host="",
db="",
port=3306,
user="",
passwd="")
Cursor = Con.cursor()
sql = "SELECT binary_data FROM pictures WHERE picture_id = '15'"
Cursor.execute(sql)
# print sql
# print idNumber
result = Cursor.fetchall()
Con.close()
return result
idNumber = 55
data = getData(idNumber)
print """Content-type: image/jpeg
"""
print data[0]
Ok see if you can wrap your head around this.. I've been hired as a contractor by this company that wants to A: Network all their computers, and B: Have all their customer data/information available to all employees on a database that can be easily read and updated.
I figured I had 2 options: Microsoft Access and MySQL. With Access, its a relatively easy interface to use and their database needs aren't very great, but I run into problems with sharing the database and its integrity (I've read that sharing an Access DB on a network is a big no-no) and redundant data. I've read about SPLITTING the database, but I don't know if that allows for easy updating of the database.
MySQL appears to be a powerful option that will allow for numerous concurrent users and seems to allow for easy data entry/updating without jeopardizing the integrity of the DB. On teh downside though, I know VERY little about how MySQL works, not to mention that I can't seem to find a decent user-frontend available to download and install on all the client machines so they can update/query the db themselves. I'm a decent programmer, but I don't know if I want to tell these guys that I'd have to WRITE my own frontend for them to use, especially since I don't think I'd be able to provide proper support for them..
So given all of this, what would u all suggest I do? I know you guys are probably more partial towards mySQL, but I don't want to put this company at risk just so I can do a test run of mySQL and how it works. On the other hand though, Access may not be enough for these guys needs especially if the company really starts to take off (right now we're talking less than 10 people using 1 DB)
I just don't want to go into this company again and when they ask me for me to go and say, "I don't know what to do about your data needs." I'd at least like to have a realistic view of our options.
I have a group of users (100 or so) that need read/write access to a document (excel) of sensitive information. Since they are all over the place, they requested a web application to be able to access from anywhere whenever they need to modify or look at this document. I'm trying to figure out what is the best way to provide a secure way to only allow these specific users to access this document. ideas have included:
Plone - complex, looking for simplicity phpBB - requires me to set up a mysql linux box somewhere which might be possible Yahoo groups - not very secure but basically what i want
any other ideas? Security of this information is the biggest priority. i currently have both linux/windows available to host.
I have a group of users (100 or so) that need read/write access to a document (excel) of sensitive information. Since they are all over the place, they requested a web application to be able to access from anywhere whenever they need to modify or look at this document. I'm trying to figure out what is the best way to provide a secure way to only allow these specific users to access this document.
ideas have included:
Plone - complex, looking for simplicity phpBB - requires me to set up a mysql linux box somewhere which might be possible Yahoo groups - not very secure but basically what i want
any other ideas? Security of this information is the biggest priority. i currently have both linux/windows available to host. i know some html, coldfusion, asp, but hosting coldfusion is a problem which is why i'm looking for preconfigured apps if possible.
There's an untold story here, by the way: all the other hardware vendors are reporting their results using
Linux. Put Debian with mySQL on this machine, and you'd probably break a $1.20 -and an Apple X-serve
using lots of RAM could probably break one dollar because its X-RAID array is so cheap.
I had an interesting question come up? How much of a speed improvement (if any) will I get by installing mod_deflate on apache?
I would think that it would be a good bit but without some sort of test I have no way of knowing. So I wrote a Test Program It requires mozilla or firefox to run but if people here would be willing to help me out It would be very good. It is not very hard. Just click on that link and then click the “run test” button. It will take over from there. It will take a few minutes to run.
Please note that this test requires Mozilla or Firefox to run.
You don’t have to send me the output, as it will store all the timing data in a MySQL database.