1. recursive query

    Date: 03/23/06 (PHP Community)    Keywords: php, mysql, database, sql

    wondering if anyone could help me, i'm trying to help a friend quickly on a project, and i'm terrible at recursive functions

    i have a table of 'genres' for music club 'venues' - each genre can have a 'parentID' if it is a sub-genre of another genre

    really roughly he has something like this -

    genre
    -----
    [genreID]
    name
    parentID

    venue
    -----
    [venueID]
    name

    venure_genre
    ------------
    [venueID
    genreID]

    I'm trying to help him build a form to submit venues into a database and assign them 1 or more genres -

    i'd like to have the genre selection be a multiple select box, with subgenres spaced over with  's i.e.



    I don't really need any help with the output as much as the query - I could do this the long way, and query all the top level genres, store them, then query each top level's sub genre's, etc etc, but i was wondering if anyone with experience writing recursive SQL querys/PHP functions could lend a hand

    thanks

    cross-posted to '[info]'mysql

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

  2. Request for help

    Date: 03/25/06 (PHP Community)    Keywords: mysql, database, sql, web

    Hi All..
    I'm working on a script that will allow admins on my website to update events.
    Basically what will happen (if I can get this to work) is the user will use some checkboxes on
    page1 that will submit the id#'s to page2. I'm streaming the id#'s into page2 as an array, where the information will be edited, and then submitted as an UPDATE statement to the database in page3 (I've confirmed the values are transmitting)

    The problem is on page 2, where the data should get called, I'm getting an error:
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
    For simplicities sake, I've
    I've put the relevant code up at  http://pastebin.com/622150  (Livejounal tends to eat code)

    If someone could take a look and tell me what I'm doing wrong or point me in the wrong direction then I'd be very appreciative.

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

  3. general site setup questions

    Date: 03/28/06 (WebDesign)    Keywords: php, mysql, database, sql, web, linux, hosting

    okay, so now that i've been picking all your brains, reading all these books, and checking out all these tutorials, last night i finally said to myself, "self, i need a god damn website."

    fast forward a few hours and now i registered a site and have some hosting thanks to godaddy. i have linux hosting because it said that's what is needed for php (correct?), but when I try to load my test page (which includes a .inc file), i get:

    Warning: main(/include/header.inc): failed to open stream: No such file or directory in /home/content/blahblahblah/1index.php on line 1

    now i tried to see if the file is where i put it (website.com/include/header.inc) but, for some reason, it loads as text. meanwhile, when i try to view a .inc file online from the site i've been maintaining for work, it asks if i want to download it. this gives me the impression that it's uploading wrong, which confuses me since i'm using Fetch both times without tweaking any settings.

    is this a case of me just trying to jump the gun and it's possible that while the ftp stuff is up and running, some other "stuff" needs to finish getting installed by them? also, it says i can have up to 15 (or 10, i forget) MySQL databases, yet damned if i know what i'll be needing them for. is that needed for include files to work, or is that for other stuff i may need?

    tried checking out tutorials but none really answer these kinds of questions, and i want to get a vague idea of what i should be asking godaddy customer support before i just sound like i'm trying to rush things too fast.

    edit: okay, now i'm confused. if i reference "/images/image.gif", so root-relative linking works in that case. yet, root-relative linking DOESN'T work for the include file. things work fine if i just make it a link (ie: include/header.inc as opposed to /include/header.inc). pretty obnoxious... how can i fix this?

    Source: http://community.livejournal.com/webdesign/1086868.html

  4. Hi!

    Date: 04/02/06 (Apache)    Keywords: php, mysql, sql, apache

    I'm new to this community and to Apache. I'm basically trying to install Apache in conjunction with PHP and MySQL, using an online manual about the topic. When it comes to the part about Apache, it only tells me to install Apache according to the instructions on the site, but I couldn't find any installation instructions on the site or in the files I downloaded from the Apache's main site. I found a file titled INSTALL, but it doesn't have an extension and my OS (Windows XP) does not recognize it. I'd appreciate all your suggestions, comments and help as to what I need to do.

    Source: http://community.livejournal.com/apache/31570.html

  5. cross posted to webdev...

    Date: 04/03/06 (PHP Community)    Keywords: php, mysql, database, asp, sql, linux, hosting

    I want to ask you guys out there for some suggegtions/advice on hosting companies. I have very specific needs:

    I need a host that:
    1) Is reliable and has good, quick customer service
    2) Supports PhP on a windows server - I need to run ASP and PhP
    3) Provides at least one SQL Server not mySQL) Database if not more
    4) Lets me run my own mail server (not sure if this is done through hosting or domain registration)
    5) Preferably lets me add sub-domains for little to no extra cash

    Right now I have Enterhost and they are awful (don't support PHP, charge out the ass, their logs don't work, you can't have sub-domains or dedicated IP's and every time I ask them for something they say no). I'm looking at maybe HostExcellence? I need something with practically no downtime, as it is for a money-making site.

    On the same subject, is it possible to move files over to the new host and access it through only the IP address before switching my domain name servers? I want to get everything moved and tested on the new server and make sure all the DB calls work before it goes live. Not sure if I could do that without hostin a second, 'testing only' domain temporarily, as I've never done a large-scale transfer like this.

    Any advice (besides 'Just switch to a Linux server') is helpful.

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

  6. Little insight from the experienced, please

    Date: 04/03/06 (MySQL Communtiy)    Keywords: php, mysql, html, sql

    One of my projects has recently started listing results multiple times. The persons in charge of the servers say they have not updated the MySQL server or made any changes. In some cases I can accommodate for this by adding DISTINCT to the query. But on other pages, this is not helping.

    From an email I just sent to my super':
    "There is something up with our SQL server. I just looked at the View Profile page which I know I haven't touched in months and its also showing the profile page twice. In the PHP and HTML, the content is only there once and is called only for the results of the query. For some reason the query is suddenly calling two results of one row."

    I am clueless about it. For over a year these things were working fine and only sending one result. Suddenly its sending two or more results for the same row.

    If you guys have any idea why the server behavior and query results would change, or an hints at MySQL idiosyncracies, let me know. Thanks.

    MySQL 4.1.11-Debian_4sarge2-log. PHP call used in the View Profile: $Result = mysql_db_query($host, $user, $password);

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

  7. Another one of those hosting questions...

    Date: 04/03/06 (Web Development)    Keywords: php, mysql, database, asp, sql, linux, hosting

    OK, so I know this is a weekly occurance here, but I want to ask for some suggegtions/advice on hosting companies. I have very specific needs:

    I need a host that:
    1) Is reliable and has good, quick customer service
    2) Supports PhP on a windows server - I need to run ASP and PhP
    3) Provides at least one SQL Server not mySQL) Database if not more
    4) Lets me run my own mail server (not sure if this is done through hosting or domain registration)
    5) Preferably lets me add sub-domains for little to no extra cash

    Right now I have Enterhost and they are awful (don't support PHP, charge out the ass, their logs don't work, you can't have sub-domains or dedicated IP's and every time I ask them for something they say no). I'm looking at maybe HostExcellence? I need something with practically no downtime, as it is for a money-making site.

    On the same subject, is it possible to move files over to the new host and access it through only the IP address before switching my domain name servers? I want to get everything moved and tested on the new server and make sure all the DB calls work before it goes live. Not sure if I could do that without hostin a second, 'testing only' domain temporarily, as I've never done a large-scale transfer like this.

    Any advice (besides 'Just switch to a Linux server') is helpful.

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

  8. converting database from PostgreSQL to MySQL

    Date: 04/05/06 (MySQL Communtiy)    Keywords: mysql, database, sql, postgresql

    Hello all.
    Sorry if this question is offtop question.
    I have dump of PostgreSQL database and now I want to use it with MySQL.
    Can You help me with converting it?
    Does anyone now how to do it? Or I should do it by hand?
    Thanks.

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

  9. Boston MySQL Meetup (Cambridge) on Monday, April 10th, 7 pm -- Performance Tuning!

    Date: 04/07/06 (MySQL Communtiy)    Keywords: mysql, database, sql

    Jay Pipes (co-author of Pro MySQL) is in town and will speak about "MySQL Performance Tuning Best Practices". This is the workshop he'll be giving at the MySQL Users Conference, so if you can't go don't miss this meetup! There will be FREE pizza and soda.

    We will have giveaways of Pro Mysql and gift certificates for free Apress books, and other swag like T-shirts, buttons, etc. RSVP for a headcount of soda and pizza at http://mysql.meetup.com/137/events/4875276/ (you will have to register; sorry.... :( )

    Description of the workshop: Learn where to best focus your attention when tuning the performance of your applications and database servers, and how to effectively find the "low hanging fruit" on the tree of bottlenecks. It's not rocket science, but with a bit of acquired skill and experience, and of course good habits, you too can do this magic! Jay Pipes is MySQL's Community Relations Manager for North America.

    We will be meeting on MIT campus, close to the Kendall stop on the Red Line (subway). There is also plenty of free parking -- you can park in ANY MIT lot after 3 pm, even if it says "parking by permit only". We are in building E51, room 372.

    If you join the meetup, you'll get these messages automatically and great things like 30% discounts on O'reilly books, discounts to conferences, etc. It's OK to repost/forward this message.

    Here is the URL for the MIT Map with the location of this building:
    http://whereis.mit.edu/map-jpg ?selection=E51&Buildings=g o

    This map shows the MBTA Kendall Stop:
    http://whereis.mit.edu/map-jpg ?selection=L5&Landmarks=go
    (the stop is in red on that map, and you can see E51 in the bottom right)

    Here are the URL's for the parking lots:
    http://whereis.mit.edu/map-jpg ?selection=P4&Parking=go
    http://whereis.mit.edu/map-jpg ?selection=P5&Parking=go

    Pizza and soda will be served, so please RSVP accurately.

    When:
    Monday, April 10, 2006, 7:00 PM 2006-04-10 07:00:00
    Where:
    MIT Building E51, Room 372
    Wadsworth and Amherst Streets
    Cambridge , MA 02117

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

  10. Running php code inside mysql calls

    Date: 04/11/06 (PHP Community)    Keywords: php, mysql, database, sql

    I'm trying to parse PHP code that is echoed from a MySQL database. Right now, it just prints the php code onto the page--how exactly would I parse this code to actually run? For example, my function would be:

    function image($imagename,$imagealign,$imagecaption)
    { echo "
    $imagecaption
    "; }


    And I want it to parse this out everytime I'd call the code, using (Keeping in mind that this is stored as text in a MySQL database--which plainly prints the italicized code rather than parses it)

    Also, how do I get the filename of my current file? Say I'm at http://blahblahblah.com/blah/info.php and I want just "info.php" rather than "blah/info.php"--what code snippet would I use?

    Thanks!

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

  11. MySQL/Perl/Tomcat

    Date: 04/12/06 (Apache)    Keywords: mysql, database, sql, google

    Hi,

    I have a problem connecting to a MySQL database through a perl script (using Per DBI drvier) running on Tomcat (tried XP and server 2000). The error that I get is: "Got an error: Bad ObjectDriver config: Connection error: Can't create TCP/IP socket (10106)" Everything works fine when I run the script from command prompt (bypassing Tomcat).  

    I've Googled and googled all day and what I found was that a lot of people have this problem, but there don't seem to be any answers.  I'm wondering if anyone ever came across a similar problem and how they've solved it.  

    Your help is very much appreciated!

    Source: http://community.livejournal.com/apache/31793.html

  12. MySql online reference recommendation

    Date: 04/13/06 (Web Development)    Keywords: php, mysql, sql, web

    Can anyone recommend a good web site for looking up MySql syntax and keywords? I am looking for something really straightforward like the php.net function search page. I thought there would be something like that at mysql.com but I cannot seem to find it.

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

  13. Finnish Revenge as mySQL Gets Solid Support

    Date: 04/15/06 (Open Source)    Keywords: mysql, sql, web

    Web 2.0 projects built on mySQL can also move ahead with confidence they’re ready as they move into transactions and as users "rush to the rail" to support them.

    Source: http://blogs.zdnet.com/open-source/?p=620

  14. PHP installation

    Date: 04/17/06 (PHP Community)    Keywords: php, mysql, sql, hosting, apache

    Hello,
    I have just recently contracted a Virtual Private Server account with a large hosting company. So far everything has gone pretty smoothly. I installed mysql and PHP and everything is running as it should. However when I installed PHP there was an option screen for me to choose what I wanted to install PHP with. I remember specifically choosing mysql support. However now when I try to run some of my pages I get this error:
    Call to undefined function: mysql_connect() in /usr/local/apache/htdocs/config.php on line 52

    Which tells me that the mysql functions were not installed.

    So to my question. How do I confirm that its not installed? If its not installed how do I install it?

    Thanks.

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

  15. MySQL to get 'solid' transactions

    Date: 04/17/06 (Application Development)    Keywords: mysql, technology, database, sql

    High-end database company Solid Information Technology will make open-source transaction engine for MySQL.

    Source: http://news.zdnet.com/2100-9593_22-6061443.html

  16. Finding Primary Key From Table

    Date: 04/19/06 (PHP Community)    Keywords: php, mysql, database, sql

    So I looked at PHP documentation and a bit at SQL documentation but couldn't find anything.

    Is there a function to select the name of the primary key row in a table (MySQL database)?

    Thanks
    --Shamess

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

  17. Admin stuff

    Date: 04/21/06 (MySQL Communtiy)    Keywords: php, mysql, database, sql

    * EDIT
    I figured it out.
    The host name was wrong. I was using localhost when it should have been the host name of the server.
    thanks for the help.



    I just started doing some admin on a MySql database. I was hoping some of you may be able to answer a few questions for me.

    1) My user table has the following rows:

    mysql> SELECT host, user from user;
    +--------------------------+------+
    | host                     | user |
    +--------------------------+------+
    | localhost                |      |
    | localhost                | root |
    | vipindo1.securesites.net |      |
    | vipindo1.securesites.net | root |
    +--------------------------+------+
    4 rows in set (0.00 sec)
    

    What I would like to know is what the are NULL users? When I create a new user using GRANT I dont get a NULL user to match.



    2)I want to create a user for my PHP scripts to run. I used this:

    GRANT SELECT ON vipinjry.* TO user@localhost IDENTIFIED BY 'password';

    When I connect from the command line it works fine. However when I use it on a script it does not work, I get an access denied for user error. I am trying to connect to the database using php's mysql_connect() function. I have used my root user to connect and it all works great, its only the users that I create that are not working. Is the host wrong? It's currently set to localhost.

    Thanks for any help.

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

  18. Unusable column names?

    Date: 04/22/06 (PHP Community)    Keywords: php, mysql, database, sql

    Whilst using PHP and MySQL I noticed that I just get an error if I try to update (or do anything with) any field with the names unique and read in the database, forcing me to have to change the names in teh database.

    For instance, I'd get an error if I do this:


    At the moment to counter that, I've had to rename 'read' to 'opened' and it works fine, but I was just wondering if there was a way that I could actually use 'read' without getting an error.

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

  19. date/time formatting

    Date: 04/22/06 (PHP Community)    Keywords: php, mysql, database, sql

    In my MySQL database is a field realdate of type datetime. I am trying to convert that string (yyyy-mm-dd hh:mm) into a different format using PHP. The format I want is d/m/yy, h:mm which I gather from the manual is specified by this: j/n/y, g:i.

    Question is, how do I use PHP to format the string that MySQL outputs?

    Outputting the string without any manipulation produces the correct dates/times. When I try using date() all my dates read 1/1/70, 10:00. No difference when I tried using strtotime().
    $post_realdate_raw = $post_result['realdate'];
    $post_realdate = date("j/n/y, g:i", $post_realdate_raw);


    If anyone would be so kind as to explain what I'm doing wrong, I would be most grateful. TIA!

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

  20. Might be a beginner question...

    Date: 04/25/06 (PHP Community)    Keywords: php, mysql, sql

    Solved:see bottom of post for more info.

    I have a .sql file that has 3 commands in it.
    2 "Create Tables table' followed by a "Insert Into table"

    Each command is terminated with a ;

    If I copy the text directly into MySQL. no problems.

    I'm trying to get a php file to run the information in the page.

    Below the cut is what I tried, what happened, and what I realized:

    I tried:

    echo "Creating tables and data for $sql_file_name...";
    $str = file_get_contents($filePath . $sql_file_name);
    if (mysql_query($str)) {
    	echo " Done.
    \n"; } else { echo mysql_errno() . ": Error on query for sqlfile $sql_file_name: " . mysql_error() . "
    \n"; die; }
    The runtime came back with
    1064: Error on querry for sqlfile address.sql:
    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 ';
    CREATE TABLE `Address_Type`
    ( `AddType_UID` int(50) NOT NULL auto_increment' at line 15
    My guess is that since PHP queries are submitted without a semi-colon that this tripped up the system. So my question:

    Is there a php command: Run_sql_in_file($filepath) ... or
    Is there a way to split my .sql string that I'm getting from file_get_contents() into an array split by the semicolon character?

    If not obvious I am quite new to PHP and pretty much self teaching as I go.

    Thanks!

    SOLVED:

    I found the explode() command. '[info]'zimzat posted at about the same time.

    I'm on the way out, but will post the final function I generated later if people are interested.

    Source: http://community.livejournal.com/php/444038.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