1. Browser problem or code problem?

    Date: 01/17/06 (PHP Community)    Keywords: php, mysql, browser, database, sql

    Ok, so I have the following code, meant to delete a category in a script I'm working on. It takes the category ID from the $_GET array, checks the database to make sure such a category ID exists, then deletes it if true or shows an error if false.

    if ($_GET['categories'] == "deletecat") {
    if (isset($_GET['delid'])) {
    $idofd = cleaninput($_GET['delid'], 1);
    $idofd = (int)$idofd;
    $check_delete = mysql_fetch_assoc(mysql_query("SELECT * FROM table_cats WHERE cat_id = '" . $idofd . "' LIMIT 1", $connect));
    if (empty($check_delete)) {
    echo "

    Error: There is no category with the ID number " . $idofd . ".

    ";
    }
    else {
    $deletecateg = mysql_query("DELETE FROM table_cats WHERE cat_id = '" . $idofd . "' LIMIT 1", $connect);
    if ($deletecateg) {
    echo "

    The category was successfully deleted.


    Go back

    ";
    }
    else {
    echo "

    The category could not be deleted: " . mysql_error($connect) . "

    ";
    }
    }
    }
    else {
    echo "

    Error: No category selected for deletion.

    ";
    }
    }


    When I execute this code, Firefox will always tell me that there is no category with the ID number specified, even when it does exist - however it will delete the category anyway. Opera does things correctly - a category is selected for deletion and the success message is shown.

    Is this a browser problem or a code problem? I have tried all sorts of different solutions, originally the code was as such:

    if (!empty($check_delete)) {

    // delete the category

    }

    else {

    // display error

    }


    However I switched it around thinking that maybe Firefox was taking too long to check the category and then finding it deleted or something like that.

    I haven't been able to test this in IE yet, but I have a feeling it might work, like it did in Opera. So... any ideas as to why it's not working in Firefox?

    Specs: PHP 5.0.5/MySQL 5.0.15 running on Windows XP (local testing server); Firefox 1.5

    Thanks in advance.

    PS: First post to this community! *Bows low*

    Edit: Solved! Firefox didn't like having a button in the form field used to get the delete ID (it's a "get" method form). Changed it to a normal link and everything now seems to be working as it should. :)

    Source: http://community.livejournal.com/php/396330.html

  2. August Burns Red

    Date: 01/13/06 (PHP Community)    Keywords: php, mysql, html, database, sql, web

    Hey Guys

    I'm new to this community. I am starting a web design company, and although I used to be decent at PHP, that was a couple of years ago and my knowledge is now pretty much non-existent. I need a script coded for a band website and I was wondering if some of you would give me a price estimate on it.

    The script is for bands that want to add shows to their website. The script needs to do the following

    - Allow a user to add / edit / delete shows to their website. The shows will be in 2 categories (which will be 2 HTML tables) which are Upcoming shows, and past shows.
    - The user puts in information in a form and it's stored in a MySQL database. The most important information is displayed in an HTML table, and in the last cell of the table will have a link for more information. When a user clicks on this link it opens up a popup window and displays ALL the information of the show (eg. Date, time, venue, cost, directions, other notes yada yada yada) in another HTML table (within the pop-up window)

    I realise that this is a pretty simple script (in comparison to what you guys have probably coded in the past, so I hope someone out there can code it for me at a reasonable price

    Thanks in advance

    Source: http://community.livejournal.com/php/394319.html

  3. Photo Gallery

    Date: 01/09/06 (PHP Community)    Keywords: php, templates, mysql, css, html, sql, java, spam

    I've been hunting all around for a decent photo gallery. There seem to be quite a few different projects, some of which are still active, available. None of them seem to accomplish what I'm looking for, though. I have tested quite a few, but all are lacking. To this end, I thought I'd ask here if anyone has anything similar to what I've been looking for.

    Major Features:
    Abstracts image URLs - hides the path and filename to prevent direct access
    Public/private flags - allows some images to stay hidden
    Tags - I'd like to be able to tag the images ala del.icio.us, LJ, Flickr
    Does not require gd - auto-thumbnails and watermarks can be disabled
    Traverses directories - new images can be dropped in a subfolder or the root image folder and will be picked up automatically
    Comments - allows for public (configurable) or private comments, either ties into phpbb or uses some sort of email validation/captcha scheme to reduce spam
    EXIF - extracts all image data form the photographs and can display it
    Uses simple cacheable CSS/XHTML templates
    Does not store images in DB
    Uses MySQL or abstraction layer that allows MySQL for comments, tags, etc
    Takes reasonable measures to be secure and speedy

    Minor Features:
    Users can upload images
    Temporary/expiring image URLs for sharing
    Hotlinking configuration - allow all, deny all, allow specific sites
    User-switchable templates
    Javascript navigation and image pop-ups optional
    Keeps stats on a pre image basis - top keywords, views, etc
    All images can be watermarked automatically
    Thumbnails may be re-generated automatically
    Can assign/rename/describe multiple photos at once

    I'm sure there are more details, but that should give a start. The scripts I've found so far are either too simple and don't have many features or too complex and require components and methods of use that I won't be using. There are a few others that store the images in the DB, which is something I'm definately against. I want to be able to FTP a directory of images and know that it will be online and ready to go as soon as the transfer is complete, or that it takes a simple click to do a rescan so they are available.

    If I have to, I'll start from scratch... I was just hoping that there would be something available that I have not yet found that could serve as a foundation to build from.

    Thanks

    Source: http://community.livejournal.com/php/392436.html

  4. Suggestions?

    Date: 04/23/05 (Web Hosts)    Keywords: php, mysql, sql, web, hosting

    I manage two domains, each under 10MB. For the past two years, they've been hosted with dr2.net, but then service got spotty and then they merged with Mesopia and the reviews got worse.

    So, I'm looking to switch both domains to a new shared host. After checking out webhostingjury.com, I like the features of the standard plan of u-hs.com but the price seems a tad too steep. Looking for something in the area of $10 to $25 a year. One of the domains I expect to migrate to PHP and MySQL in the next few months.

    Suggestions?

    Source: http://community.livejournal.com/webhosts/26292.html

  5. Subnixus.com - 3 easy ways to earn free domain hosting.

    Date: 04/18/05 (Web Hosts)    Keywords: php, mysql, database, sql, hosting

    www.subnixus.com now has three easy ways to earn free hosting.

    1. Being an active member of the forum. It's that simple, by posting on our forum you can earn free hosting. Read about it here: http://www.subnixus.com/forums/viewtopic.php?id=798

    2. By signing up for one of our sponsers, such as DISH Network, you can earn one year of free hosting. Read about it here: http://www.subnixus.com/forums/viewtopic.php?id=799

    3. By making a donation of $10 or more you will earn one year of free hosting. Read about that promotion here: http://www.subnixus.com/forums/viewtopic.php?id=802

    Your hosting package will be reviewed and given on a case by case basis. The minimum package includes (but you could qualify for more):

    www.yourname.com
    125MB of Space
    1G of bandwidth
    1 MySQL Database
    POP Email
    Control Panel
    FTP
    (basically anything you need to get your site up and running)


    This new program starts this week. All accounts that are earned between April 18 - 22 will be setup on Sat. the 23rd. Please visit www.subnixus.com for all of the details.

    Source: http://community.livejournal.com/webhosts/26063.html

  6. the web hosting question...

    Date: 12/14/05 (Web Development)    Keywords: php, mysql, database, sql, web, apache

    I was wondering if anyone could recommend me a webhost that will meet the following requirements:

    + I want as much control as possible. If I decide one week I want to mess around with OracleDB, I want to be able to install it. If I want to use Ruby on Rails, I want to be able to install that too. I basically want to be able to do as much server administration as possible

    + I have the following musts: PHP 5, Apache, MySQL(preferred, but some kind of database)

    + I need a decent amount of space and bandwidth, but not a whole lot.

    I have considered a dedicated server, but it seems to be far too expensive for now at least. Any ideas?

    Source: http://community.livejournal.com/webdev/279180.html

  7. Update multiple tables

    Date: 01/19/06 (MySQL Communtiy)    Keywords: php, mysql, sql

    ** EDIT
    turns out the problem is my version of mysql, thanks for the help.



    Hi, I am having a problem trying to update ids in a table.

    I am using PHPmyAdmin.

    I looked at the syntax on mysql.com and I am fairly certain that I have it right but I get the following error:

    #1064 - You have an error in your SQL syntax near ' drugs SET synonyms.drug_id = drugs.drug_id WHERE 'synonyms.drug_name' = 'drugs.' at line 1

    The two tables are as follows:

    drugs
    drug_id | drug_name

    synonyms
    drug_id | synonym | drug_name

    This is my SQL statement:
    UPDATE synonyms, drugs SET synonyms.drug_id = drugs.drug_id WHERE 'synonyms.drug_name' = 'drugs.drug_name'

    Source: http://community.livejournal.com/mysql/83525.html

  8. do you know about binary logs?

    Date: 01/19/06 (MySQL Communtiy)    Keywords: mysql, database, sql

    These tech communities are mostly questions from those that need help which I often do :)
    I thought it'd be fun to change the pace a little and post some info I think is good to know if your using mysql.

    I've recently had problems with table crashes and running mysql in an environment with very little disk space. This has taught me a few things I did not know before hand. One of which is mysql's binary log (also known as the update log in older versions). It stores all statements that are run that could potentially modify data in the database which allows restores to work as best as possible (i.e. even if your backup is a bit old). For more info check the binary log docs

    Source: http://community.livejournal.com/mysql/83396.html

  9. mysql 4/5 && TIME_WAIT

    Date: 01/18/06 (MySQL Communtiy)    Keywords: php, mysql, sql

    good evening! has anybody ever seen mysql clients (mysql, php, check_mysql(nagios), etc) choke with an error similar to 'can't assign requested address' ? I've got over 30,000 connections listed in netstat with a status of TIME_WAIT. fairly basic php/mysql site (high traffic), no apparent cause.

    possible causes I've thought of:

    - maybe somebody initiated a connection but didn't close it.. thrwarted due to the mysql reporting otherwise.
    - mysql being retarded? not likely, when the error occurs, no incoming connection is reached by the mysql server (via tcpdump/ngrep), resource usage on the server is fine. same with the process list.
    - max files being reached?

    any thoughts? :D

    Source: http://community.livejournal.com/mysql/82879.html

  10. repair table problems

    Date: 01/17/06 (MySQL Communtiy)    Keywords: mysql, sql

    I have a table that is all messed up so I ran 'repair table my_table'. The problem is that it never completed and didn't give me any error messages. The table is a little bit (a bit over 1 gig), but mysql is using 0.0% of the cpu so it doesn't look like it's doing anything. Does anyone have any ideas to help save my data?

    Source: http://community.livejournal.com/mysql/82528.html

  11. Trying To Select Some Data

    Date: 01/15/06 (MySQL Communtiy)    Keywords: php, mysql, sql

    i'm trying to select some data from a table. this bit i'm doing quite well with, however it's returning two rows per 'primary key' based on a left join. i've tried using DISTINCT but that doesn't seem to effect it. i then i tried using GROUP BY and that did, so now i'm getting the one row per primary key i was originally after, but i seem to be getting this data without the data of the left join i so desperately need. upon further investigation, back when i was getting two rows per primary key, only the second row per primary key had the data i was after. is their anyway to make sure the query returns the second row as opposed to the first?

    my initial idea was to add a clause, but not all rows in the table will have data in that column, i just want to make sure rows with data in that column will definately be returned.

    any suggestions?




    x-posted to '[info]'mysql and '[info]'php_mysql

    Source: http://community.livejournal.com/mysql/81895.html

  12. Boston MySQL Meetup Group

    Date: 01/06/06 (MySQL Communtiy)    Keywords: mysql, sql, google

    The MySQL Meetup group meeting on Monday, January 9th will focus on backups -- I will give a 30-45 minute presentation on backups and we will then delve into a discussion -- how folks within the group are backing up, how they're not backing up, how they'd like to back up. If there's time, we'll do a "lessons learned from backup horror stories".

    Afterwards, we'll head a few doors down to Boston Beer Works for more chatting.

    You can see a video of last month's presentation by Philip Antionades of MySQL AB on the new features in MySQL 5.0 at Google Video:

    http://video.google.com/videosearch?q=Mysql+5.0+by+Philip+Antoniades

    (we will video this month's presentation but not the discussion)

    More details, including the event location and directions, are at: http://mysql.meetup.com/137/events/

    I encourage you to sign up to receive notification of events, and participate in discussions outside of the meetups. I won't always be posting here.

    Any questions, comments, etc should be sent to me. We're currently looking for a space better than North Station -- something around MIT might be nice, and we're trying to get an MIT grad student/faculty/staff member/organization to sponsor it. (We want a location that's good for people driving AND taking the T, and when the Garden has an event, it's not feasible to park there). If you can help out, please let me know.

    (You may forward this announcement to other groups, lists, blogs, whatever.)

    I'm quite excited about the presentation, as I'm writing down a lot of information from different sources that really wants to be together, but as far as I can tell is not yet, at least not in a public place.

    Source: http://community.livejournal.com/mysql/81107.html

  13. PHP and MYSQL help

    Date: 01/03/06 (MySQL Communtiy)    Keywords: mysql, database, sql

    While trying to connect to the mysql database, I get this error:
    Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    So I look up the solutions for this error. I discover that I need to edit a my.cnf file and change the socket setting. I wish it was that easy. I check what socket is set too.

    [client]
    #password = my_password
    port = 3306
    socket = /opt/local/var/run/mysqld/mysqld.sock

    Not the socket the server is trying to connect to.

    The file is located in /opt/local/etc/mysql4 and I also copied it to /opt/local/etc incase.
    The password and username is correct, I can manually connect to the database.
    Using a Mac OSX.4 server.
    DB Server version is 4.1.15
    Connection: Localhost via UNIX socket

    I am out of ideas, can anyone help me?

    Source: http://community.livejournal.com/mysql/80709.html

  14. Stopwords

    Date: 01/01/06 (MySQL Communtiy)    Keywords: php, mysql, sql

    Ok, new problem.

    I have got my fulltext searches to work, but am very much against the idea of stopwords. many of them I want people to be able to search.

    Now I have tried setting the path of the file containing them to nothing, but my shell access is having an off day (plus I don’t really want to change thing in there).

    Is there a way in the query of letting some of the stopwords pass. I’m using version 4.0.25

    Thanks for any help

    x posted to '[info]'php (because they use mysql too)

    Source: http://community.livejournal.com/mysql/80433.html

  15. Duplicate result rows

    Date: 12/28/05 (MySQL Communtiy)    Keywords: mysql, database, sql

    I am trying to make it so this result can be ordered by the last name of the client. However, the name is in another table thus the JOIN LEFT. That part seems to be working OK (I think), but where I am running into a problem is that the results are showing duplicates (example if invoice 10, there are 3 result rows for invoice 10, but only 1 row in the actual MySQL table "invoice_main").

    (Yes, there are some name/case mismatches, but I didnt create the database.)

    Thanks!

    SELECT DISTINCT
    invoice_main.invoice_number,
    invoice_main.invoice_date,
    invoice_main.due_date,
    invoice_main.clientid,
    invoice_main.subtotal,
    invoice_main.paid_amounts,
    invoice_main.payment_status,
    clients.ClientLast
    FROM $TableName
    LEFT JOIN clients ON invoice_main.clientid=clients.ClientID
    WHERE invoice_main.office_id='$office_id'
    ORDER BY $SortParam
    LIMIT $limit,$Limit_increment


    Adding GROUP BY invoice_main.invoice_number gave me an SQL error


    [UPDATE] Figured it out
    LEFT JOIN clients ON invoice_main.office_id=clients.office_id AND invoice_main.clientid=clients.ClientID

    Gotta thank '[info]'jedifreeman and his help with JOIN a couple weeks ago. I was re-reading our AIM conversation and thought of this.

    Source: http://community.livejournal.com/mysql/80119.html

  16. Fulltext index error

    Date: 12/16/05 (MySQL Communtiy)    Keywords: mysql, sql

    This is bound to be something simple I've overlooked (and besides, I'm new at this)...

    First, the table. Created from a pre-existing spreadsheet for a community library so please forgive the non-optimum design...


    mysql> create table books (
    -> book_id mediumint unsigned not null auto_increment,
    -> author1 varchar(255) not null,
    -> author2 varchar(255) not null,
    -> title varchar(255) not null,
    -> subtitle varchar(255) not null,
    -> subject1 varchar(255) not null,
    -> subject2 varchar(255) not null,
    -> subject3 varchar(255) not null,
    -> subject4 varchar(255) not null,
    -> publisher varchar(255) not null,
    -> year smallint unsigned not null,
    -> loc varchar(255) not null,
    -> edition varchar(255) not null,
    -> isbn varchar(255) not null,
    -> location varchar(255) not null,
    -> notes varchar(255) not null,
    -> PRIMARY KEY (book_id)
    -> );
    Query OK, 0 rows affected (0.01 sec)


    Then a data import (load data local infile "/home/lev/Desktop/test.csv" into table books;) - no problem.

    Then adding a fairly large fulltext index i.e.,

    mysql> alter table books add fulltext index (author1, author2, title, subtitle, subject1, subject2, subject3, subject4, publisher, location);

    But a search, any search e.g.,

    mysql> select * from books where match (author1,author2) against ('ali');
    ERROR 1191 (HY000): Can't find FULLTEXT index matching the column list

    help?

    Source: http://community.livejournal.com/mysql/77082.html

  17. PHP + MySQL 4.1

    Date: 01/20/06 (PHP Community)    Keywords: php, mysql, database, sql, web, apache

    FIXED. Thanks to '[info]'afromann, '[info]'cowsandmilk, and '[info]'nentwined!

    I've been looking around since yesterday and just can't seem to find a definitive answer -- how exactly do you use MySQL 4.1.x with PHP 4.x?

    Needing some of the functionality available in MySQL 4.1 (and since our host has that as well), I installed it, updated my phpMyAdmin settings, and came across "Client does not support authentication protocol requested by server; consider upgrading MySQL client" message. So I went looking for a fix for that. It told me I had to use the mysqli extension for PHP, but since I installed PHP using the installer (I am on a Windows machine, with Apache), I uninstalled PHP, downloaded the binary zip... but can't find the mysqli extension in the extensions folder in the zip.

    So now I am in a quandary. The mysqli extension is not in the binary zip; is it only for PHP5? But the host we're on has MySQL 4.1.x AND PHP 4.x! The manual says something about compiling PHP with support for the mysqli extension -- do I have to recompile PHP4, is that it?

    Help, advice, suggestions, etc would be very much appreciated, thanks.


    Windows XP Pro
    Apache 1.3 (I'm using Apache 2.0 on ANOTHER machine)
    MySQL 4.1.16
    PHP... well, none as of the moment, but I was using PHP 4.3.x; I'm trying to install 4.4.2

    (Ask if there's anything else needed.)

    Update: I thought it would be good to post an update since the update might be significant and people don't always check other comments. :)

    Actually, I just got phpMyAdmin working -- not exactly sure what happened there, as the only thing I did was create another mysql user with access to all the databases and use that for phpMyAdmin. I thought my problem was fixed but now I'm trying to log into the webapp I'm working on, to no avail -- the script just plain dies (no warnings, errors, messages, nothing) when I call mysqli_connect( host, user, pw, database). Echoing before and after that line--

    echo 'before call';
    $link = mysqli_connect( host, user, pw, database ) or die( 'Error: ' . mysqli_connect_error() );
    echo 'after call';


    The ONLY output is "before call". NONE of the code after the connect gets run, and obviously the die() didn't work either (or didn't output anything within the parentheses, anyway). Hence I'm a little confused why phpMyAdmin is working (without recompiling php, and without the extension dll either since I can't find it) but my script can't. I'm assuming it's BECAUSE I haven't recompiled PHP, so... yeah.


    Fix: I'm not sure why phpMyAdmin can connect using php4 without having to use MySQL's old password hashing algorithm for its user, but it's probably just amazing that way. Used the OLD_PASSWORD() function to change the password for my script's user, and now it's working fine again with the ordinary mysql_* calls. :)

    Crossposted: '[info]'php, '[info]'webdev, '[info]'developers

    Source: http://community.livejournal.com/php/399323.html

  18. CMS

    Date: 01/25/06 (PHP Community)    Keywords: cms, php, mysql, asp, sql, web

    Following up from my last post, are there any good CMSes out there for a really small site?

    I mostly use my personal site as a support resource for online roleplaying games that I run, but I'm tired of needing to upload to the site by FTP whenever I want to change one little thing on a page. At the same time, I like have a visual basis for character sheets and so on... (http://www.patchwolf.com/phoenixcrusade/terpsichore.php for an example). I'd also like to give my players the chance to add stuff directly to the site -- kind of like a wiki.

    Of particular concern are the character sheets, where I'd like to still be able to change one detail (like the current form aspect on the example sheet -- currently controlled by an in-page variable), which then affects several other aspects (strength, stamina, health, etc....)

    A good mate of mine uses Qwikiwiki (http://www.qwikiwiki.com), which uses a flat-file system -- but if I want to have a hope of maintaining a visual basis on any part of the site, Qwikiwiki's not going to cut it. While I have PHP and MySQL on my web host, I don't actually
    run the server myself, so that's also something to take into consideration.

    Any ideas?

    Source: http://community.livejournal.com/php/401978.html

  19. If $variable contains....

    Date: 01/26/06 (PHP Community)    Keywords: mysql, sql, spam

    Can someone help me out with a spam protection?
    How do I make a query like this:
    if $blahblah CONTAINS (http:// || www. || something) { do something }

    So, it's not an exact match, but something that matches anything of the submitted text. It's for a spam protection in a MySQL Guestbook, if that helps...

    Thnx! :)

    Source: http://community.livejournal.com/php/402335.html

  20. Simple Database Display Tool

    Date: 01/26/06 (PHP Development)    Keywords: php, mysql, software, database, sql, web

    I spent a good long time cataloging my huge collection of movies and putting into databases. Now I've got to write some php code to display (and possibly administer) all of this information, which I am not looking forward to.
    I keep hoping that there's something previously written than I can modify. The concept is simple enough: I need something to display large amounts of tabular data succinctly to end users on my website. I want users to be able to add or remove columns to what they are viewing. They should also be able to sort on any column they wish. All this needs to work seamlessly, as if the user were facing an Excel spreadsheet.
    Do any of you have suggestions for me on softwares I might try, or have any of you written code to do this already? Thanks in advance for your help.

    X-posted to '[info]'php_mysql

    Source: http://community.livejournal.com/php_dev/64170.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home