-
Gah.
Date: 07/08/05
(WebDesign) Keywords: php, mysql, html, asp, sql
Hope this isn't a bother.
I'm trying to find a random quote generator that uses HTML or PHP. If it's possible to do it without MySQL, ASP, etc etc etc. Anybody? Beuller?
Rock on. <3
Source: http://www.livejournal.com/community/webdesign/924390.html
-
Help creating a query
Date: 07/11/05
(PHP Community) Keywords: php, mysql, sql
I need some help with a query I'm trying to create to send to MySQL. The problems are on the PHP side, so I'm posting here rather than at mysql.
I have an array of starting letters. I'm trying to select all projects that start with a letter in an array. The array will have at least one letter, possibly more.
Here is the code that's causing me confusion:
foreach ($startlet as $let){
$sql.=" $projectcolumn[title] LIKE '".$let."%'";
}
I need to put an OR in there at the end of every line but the last. Is there an easy way to do this, or am I going to need to get the length of the array, then iterate some number and compare? I'm fine with a different control structure, but I couldn't find anything that would easily and simply do what I want. Is there one, or am I just going to have to be satisfied with complex?
Edit: Never mind
Figured I could do it this way. Maybe not so pretty, but functional.
$i=0;
while ($i<(count($startlet)-1)){
$sql.=" $projectcolumn[title] LIKE '".$startlet[$i]."%' OR";
$i++;
}
$sql.=" $projectcolumn[title] LIKE '".$startlet[$i]."%'";
Source: http://www.livejournal.com/community/php/317164.html
-
Understand Error messages
Date: 07/13/05
(PHP Community) Keywords: mysql, sql
I am using echo mysql_error();
to help debug my code.
Would this statement return
"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"
if there were no records that matched the query?
Source: http://www.livejournal.com/community/php/318263.html
-
SQL Injection
Date: 07/14/05
(PHP Community) Keywords: php, mysql, sql
Whenever I've got a mysql query and the user is inputting something in a feild (let's just say for example a login page), I add addslashes to every GET and POST request. Is there anything else I can do to protect myself from sql injection? I'm fairly new to mysql so I'm not entirely sure of all of its commands and what not. I thought it would be appropriate to post this in a PHP community, though, because everything that I would have to worry about is in my php coding.
Any help is greatly appreciated.
Source: http://www.livejournal.com/community/php/318792.html
-
Programming
Date: 07/15/05
(Computer Geeks) Keywords: php, css, html, xml, sql, java
I'm looking to learn some computer languages and programs
and I have this simple list here:
- Java
- Java Script
- Perl
- C
- C+
- C++
- PHP
- SQL
- VBasic
- CSS
- HTML
- XML
- Adobe Photoshop
- Adobe Illustrator
Am I missing anything?
|
Source: http://www.livejournal.com/community/computergeeks/726141.html
-
PEAR:DB
Date: 07/17/05
(Code WTF) Keywords: sql
$db->qwerty($sql);
Source: http://www.livejournal.com/community/code_wtf/11760.html
-
Choices for a flexible CMS
Date: 07/17/05
(WebDesign) Keywords: cms, php, mysql, database, sql
I know, another "what CMS should I use?" question. But hear me out. I'm looking for a CMS that's flexible, easy to set up, allows all users to submit content, and has some sort of mechanism for reviewing items (like Epinions or Amazon or Yelp.)
I can run PHP (safe mode only) or Perl, and I've got a MySQL database.
Any suggestions? Please?
Source: http://www.livejournal.com/community/webdesign/930368.html
-
Photo Gallery Scripts?
Date: 07/18/05
(PHP Community) Keywords: php, mysql, database, sql
Anyone know of any photo gallery scripts that will do the following?
1. Show a preview for each category.
2. Randomize a the preview from each category.
3. Allow a single image to be included in multiple categories.
I'm working with a team that is going to eventually do this in flash with an animation and such but they asked if I could do this in php in the meantime and they'll integrate the flash my php later. I'm a PHP/MySQL database guy so this is new to me...
Source: http://www.livejournal.com/community/php/320514.html
-
returning data from newly inserted row in a mysql table
Date: 07/18/05
(PHP Community) Keywords: mysql, sql
is there a function that returns data from newly inserted rows in a mysql table? i have a table i'm inserting rows into, with an auto-incrementing id field. that id is used as a foreign id in another table which i need to insert rows into immediately after. a simple version might look like this:
\USERS\
id | name
1 | tom
2 | jen
3 | sam
\NOTES\
id | foregn_id | note
1 | 1 | note for tom
2 | 1 | note for tom
3 | 1 | note for tom
4 | 2 | note for jen
5 | 3 | note for sam
$sql = "INSERT INTO users (name) VALUES ('bob')";
mysql_query($sql);
so now in the users table we'll probably get
4 | bob
and immediately after in the script i'd need to do
$sql = "INSERT INTO notes (foreign_id,note) VALUES (4,'note for bob')";
mysql_query($sql);
what i'm doing now is constructing a query that finds the id for 'bob', then using it in the follow-up query. so, in total, we'd have
$sql = "INSERT INTO users (name) VALUES ('bob')";
mysql_query($sql);
$sql = SELECT * FROM users WHERE name = 'bob';
$id = mysql_result(mysql_query($sql),0);
$sql = "INSERT INTO notes (foreign_id,note) VALUES ($id,'note for bob')";
mysql_query($sql);
except my code is far messier because i'm dealing with more fields and more data. which brings us back to my original question! is there a cleaner way to get the id of the row i just inserted?
Source: http://www.livejournal.com/community/php/320911.html
-
Lame Nerd Question
Date: 07/20/05
(Computer Geeks) Keywords: php, mysql, sql, web, linux, hosting, apache
Here's what's happening:
My company seems to be dragging its feet on upgrading the Solaris server on which I'm supposed to be running this website I'm developing. I've been hosting on my own external server, and when this summer internship is over, I have to move everything over regardless of whether or not the server is ready.
Consequently, people in my department are trying to hunt down an extra Unix box for me to use as a pseudo-server until the real server is (finally) upgraded.
So here's my question:
I've only touched Unix very remotely, as in using an SSH command-line console with my school's web server. I'm a little familiar with basic Linux commands, but that's about it. How difficult would it be for someone like me (who only uses Linux when she has to for classes) to install Apache, PHP, and MySQL...as well as migrate over my existing website (currently running on a Red Hat 9 server with Apache, PHP 4.x, and MySQL 3.2.3 or something similar)?
Any info would be greatly appreciated.
Source: http://www.livejournal.com/community/computergeeks/730050.html
-
mysql questions
Date: 07/20/05
(PHP Community) Keywords: mysql, html, sql
http://www.livejournal.com/community/mysql/62230.html
i posted about a little mysql issue i'm working out over in mysql
any of you mysql-heads that want to give me some advice, have at it
Source: http://www.livejournal.com/community/php/322672.html
-
Time handling problem
Date: 07/21/05
(PHP Community) Keywords: mysql, sql
I want to report back to the user how long it's been since their last login. I'm having a problem processing the time, though.
$query = "SELECT DATE_FORMAT(date_last,'%c-%d-%Y %k:%i:%S') dl,
DATE_FORMAT(NOW(),'%c-%d-%Y %k:%i:%S') dn FROM people WHERE
(user_id=$id AND password=PASSWORD('$pass') )";
$result = mysql_query($query);
if (mysql_num_rows($result)==1) {
while ($row=mysql_fetch_array($result)) {
$lasttime = $row['dl'];
$nowtime = $row['dn'];
$timediff = round((strtotime($nowtime) - strtotime($lasttime)) / (60*60));
echo "You last logged in $timediff hours ago.";
}
}
Here is what I get:
// $nowtime == string(18) "7-21-2005 10:51:40"
// strtotime($nowtime) == int(1393429900)
// $lasttime == string(18) "7-20-2005 21:21:59"
// strtotime($lasttime) == int(1390789319)
You last logged in 733 hours ago
I had understood that strtotime() will parse GNU standard date formats into seconds, so I had assumed multiplying the difference in dates by 1200 would get the difference in hours.
I don't understand why I'm getting 733 hours offset instead of 13. Can anybody tell me what I've got wrong here?
Edit: A saner MySQL query does the trick. Thanks to those who helped.
Source: http://www.livejournal.com/community/php/323703.html
-
Possible web development job/need to learn PHP
Date: 07/23/05
(Web Development) Keywords: php, mysql, sql, web
Yesterday I had an interview at a great web design firm here. The interview went great, and I'm going back in on Tuesday for a second interview. One of the only things that was a "negative mark" for me was that I don't know how to code in PHP (I know, I know..."get with the times dumbass!"), however, I learn incredibly fast and I decided after the interview that I would make sure I have a solid understanding of the language before I go into the second interview on Tuesday.
I spent all day yesterday reading books and web sites about PHP and MySQL and I'm already able to write relatively simple scripts without relying on references. What I'm looking for now are web sites that have something more intermediate that I could try my hand at (as opposed to the basic lessons most websites give...which are typically based around the same concepts). I've found that I usually learn better when I get the basics of a language down and then jump into stuff a bit over my head...struggling makes me try harder and helps things stick in my head.
Anyone know of a website or two with good, advanced PHP lessons?
Source: http://www.livejournal.com/community/webdev/224748.html
-
Possible web development job/need to learn PHP
Date: 07/23/05
(WebDesign) Keywords: php, mysql, sql, web
Yesterday I had an interview at a great web design firm here. The interview went great, and I'm going back in on Tuesday for a second interview. One of the only things that was a "negative mark" for me was that I don't know how to code in PHP (I know, I know..."get with the times dumbass!"), however, I learn incredibly fast and I decided after the interview that I would make sure I have a solid understanding of the language before I go into the second interview on Tuesday.
I spent all day yesterday reading books and web sites about PHP and MySQL and I'm already able to write relatively simple scripts without relying on references. What I'm looking for now are web sites that have something more intermediate that I could try my hand at (as opposed to the basic lessons most websites give...which are typically based around the same concepts). I've found that I usually learn better when I get the basics of a language down and then jump into stuff a bit over my head...struggling makes me try harder and helps things stick in my head.
Anyone know of a website or two with good, advanced PHP lessons?
Source: http://www.livejournal.com/community/webdesign/935935.html
-
Book Rec?
Date: 07/24/05
(Computer Geeks) Keywords: sql, java
Has anyone read/got Head First Design Patterns? What did you think? I'm considering getting it.
I'm not a hard core coder myself right now (I hve been in the past but I was working strictly procedurally, this was before OOP really took off), in my job I just occasionally have to write the odd bit of code, generally to link a couple of existing apps together or to pull some data out of one app and make it ready for loading into another app or a reporting tool. I also sometimes have to talk to developers and think it would be helpful to get more of a grip on what they are talking about. I principally use PL/SQL or C/C++ but lately I've started to learn Java and it looks like I'm going to have to learn Perl and/or Python for a project that's coming up.
Do you think that book would be any use for me? Or should I be looking for something a bit more basic.
Source: http://www.livejournal.com/community/computergeeks/733511.html
-
little help
Date: 07/24/05
(MySQL Communtiy) Keywords: mysql, sql, web
**Before asking this, I did go to the normal help sites (mysql.com...) and also scoured the web for other info. Way to complicated.
I need some help specifically for the process of setting user permissions running on XP. I'm trying to create DB's and tables and in some places I'm getting "Access Denied" errors. If anyone could point me in the right direction (i.e. your personal knowledge, a website like MySQL for Dummies..) would be much appreciated.
Source: http://www.livejournal.com/community/mysql/63395.html
-
Book Rec?
Date: 07/24/05
(IT Professionals) Keywords: sql, java
Has anyone read/got Head First Design Patterns? What did you think? I'm considering getting it.
I'm not a hard core coder myself right now (I have been in the past but I was working strictly procedurally, this was before OOP really took off), in my job I just occasionally have to write the odd bit of code, generally to link a couple of existing apps together or to pull some data out of one app and make it ready for loading into another app or a reporting tool. I also sometimes have to talk to developers and think it would be helpful to get more of a grip on what they are talking about. I principally use PL/SQL or C/C++ but lately I've started to learn Java and it looks like I'm going to have to learn Perl and/or Python for a project that's coming up.
Do you think that book would be any use for me? Or should I be looking for something a bit more basic.
Source: http://www.livejournal.com/community/itprofessionals/16080.html
-
yeah.. i'm stuck.
Date: 07/25/05
(MySQL Communtiy) Keywords: mysql, database, sql
Hey everyone, I'm new to the community.. i'm curious if anyone has seen anything like this. i've got a RHES3 (Fedora Core 3/4 tested as well) server running running 4.1.10a.
Long story short.. mysql runs fine minus seemingly random spiked load averages caused by a pileup of locked connections due to an UPDATE query. While query runs, all additional updates are locked. Sometimes it lasts 2 minutes, sometimes it lasts 30 minutes. You'll notice my lingo is more admin oriented, that's because I'm the sysadmin and not the programmer. Our guys who create and program the site don't have much insight to resource usage.
The query looks like this: UPDATE shockwave_traffic SET minutes_vis = minutes_vis + 1 WHERE game_id = '1' AND start_hour LIKE '2005-07-24 20%';
root 19379 0.0 0.0 5860 996 ? S 20:44 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql --open-files=4096 --datadir=/usr/local/mysql/data -O max_heap_table_size=1000m --log-slow-queries --skip-bdb --skip-innodb
mysql 19423 99.9 1.9 472984 75136 ? S 20:44 108:28 \_ /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/data/moe.pid --skip-locking --open-files-limit=4096 --port=3306 --socket=/tmp/mysql.sock -O max_heap_table_size=1000m --log-slow-queries --skip-bdb --skip-innodb
random tidbits i've noticed while troubleshooting:
- load avg stays between 2.00 -- 3.00 which is fine, i would think if a process were truly taxing a CPU for 99% of it's resources the load would be MUCH higher. see my next tidbit.
- during peak times and not during peak times at seemingly un-andom intervals, the load will jump to 30. When this happens I check the process list and there's one UPDATE query running and theres a full connection limit of locked queries, I believe said locked queries are waiting for the update query to finish.
- table size is tiny, 400k -- there are other tables within the db that are 2.2gb that aren't accessed, purely around for archival reasons. I've ran myisamchk and there isn't any errors being reports, check table via the CLI reports no errors as well.
- nothing in the slow query log.
- binary log disabled.
- I've had this problem on databases housed on other machines while doing SELECT (using AS), but raising the max_heap_table_size was able to calm them down.
Hardware info:
Dell poweredge 2850
Raid 5 via PERC4 dual channel raid adapter
3 15K SCSI drives.
Dual 3.2ghz Intel Xeon processors (HT enabled, although this has been disabled with the same effect).
Any thoughts or insight would be greatly appreciated. :D
Source: http://www.livejournal.com/community/mysql/63772.html
-
Frustration....
Date: 07/26/05
(MySQL Communtiy) Keywords: php, mysql, html, sql, web, microsoft, google
Windows XP SP2
MySQL Version -- 4.1.13
PHP Version -- 5.0.4
Web Server -- IIS 6.0
Dreamweaver MX 6.1
Frustration Level -- Through the ROOF!!!
Last I posted, I was having troubles with permissions. Well, to resolve that little issue I re-install MySQl. Admin permissions are now accessible.
PROBLEM: I am unable to connect to my test server through Dreamweaver MX. I was getting the oh so helpful error message: "An unidentified error has occurred." I changed some permissions (I don't know which ones at this moment) and then I was getting the error message "HTML error code 403 forbidden". Now, I'm back to "An unidentified error has occurred." It's got to be a permissions issue but for the life of me I can't figure out which ones. I am also having an issue viewing "http://localhost/" without having to enter a password. I can view other pages on localhost just not the root. I'm sure that has something to do with my test server issue. I have gone through the MySQL manual online and offline. I scoured microsoft.com and msdn for help with the Windows permissions. I have googled all there is to google and I want to google NO MORE. I did find an article reguarding my helpful "An unidentified error has occurred" message (link - technote).
It said to install 6.1 updater for Dreamweaver MX, so I did and no change. I re-ployed the connection scripts and no change. I stopped and restarted the services and nothing. I meticulously inspected all folders that need to be accessible for the server and whatever else needs them, and no dice. I found this technote (Technote), useless. I have pretty much done everything that flipping article said and any other articles that I have found and of course no change.
So there inlays my dilemma. Where do I go from here????
*off to scream*
Source: http://www.livejournal.com/community/mysql/64173.html
-
MySQL Test server issues...
Date: 07/26/05
(Computer Geeks) Keywords: php, mysql, html, sql, web, microsoft, google
To anyone here who is familiar with MySQL or can put me on the right path to resolving this:
Windows XP SP2
MySQL Version -- 4.1.13
PHP Version -- 5.0.4
Web Server -- IIS 6.0
Dreamweaver MX 6.1
Frustration Level -- Through the ROOF!!!
PROBLEM: I am unable to connect to my test server through Dreamweaver MX. I was getting the oh so helpful error message: "An unidentified error has occurred." I changed some permissions (I don't know which ones at this moment) and then I was getting the error message "HTML error code 403 forbidden". Now, I'm back to "An unidentified error has occurred." It's got to be a permissions issue but for the life of me I can't figure out which ones. I am also having an issue viewing "http://localhost/" without having to enter a password. I can view other pages on localhost just not the root. I'm sure that has something to do with my test server issue. I have gone through the MySQL manual online and offline. I scoured microsoft.com and msdn for help with the Windows permissions. I have googled all there is to google and I want to google NO MORE. I did find an article reguarding my helpful "An unidentified error has occurred" message (link - technote).
It said to install 6.1 updater for Dreamweaver MX, so I did and no change. I re-ployed the connection scripts and no change. I stopped and restarted the services and nothing. I meticulously inspected all folders that need to be accessible for the server and whatever else needs them, and no dice. I found this technote (Technote), useless. I have pretty much done everything that flipping article said and any other articles that I have found and of course no change.
So there inlays my dilemma. Where do I go from here????
*off to scream*
Source: http://www.livejournal.com/community/computergeeks/736061.html