1. Testing stages

    Date: 09/13/05 (WebDesign)    Keywords: php, mysql, css, html, sql

    I'm currently working on a text based RPG that is in the testing an development stages. I'd like to get an opinion on it. Considering it is my first time working with php, mysql, and css. I was always a HTML girl.

    http://www.divineillusion.us

    Source: http://www.livejournal.com/community/webdesign/976981.html

  2. Testing stages

    Date: 09/13/05 (Web Development)    Keywords: php, mysql, css, html, sql

    (Ugh, I updated to the wrong community the first time. Copy/paste baby!)

    I'm currently working on a text based RPG that is in the testing an development stages. I'd like to get an opinion on it. Considering it is my first time working with php, mysql, and css. I was always a HTML girl.

    http://www.divineillusion.us

    Source: http://www.livejournal.com/community/webdev/243364.html

  3. WebSQL?

    Date: 09/13/05 (Web Development)    Keywords: php, database, sql, web

    I have been working on some databases that I'd like to put up on the web eventually. They are mostly inventories of my philatelic, numismatic collections, mp3s, videos in Excel format right now. I would be able to add, update, and remove entries from my website (with admin password of course) using forms or if I have tons of entries to do I can upload the updated database instead. Visitors, including myself would be able to search the databases by using dropboxes to narrow down the query and find relevant entries or use a simple keyword search. The results would be displayed in a table with links to individual entries than would be displayed in a form-like fashion with any graphic available relating to the entry (ex. a photograph of a coin).

    The problem is, i have no clue how to do this. First of all, what format should these database be in? Access dbs? What resources are there to learn how to set up this searchable/queriable database? I intend to have these searchable inventories on my website and the individual pages are php. So the display of these results should be compatible with them. Do I use WebSQL? I need to learn how to set up a form and have it hooked up with the database, but what language is it?

    I'm so clueless I don't even know where to look. Any help is appreciated!

    Source: http://www.livejournal.com/community/webdev/243879.html

  4. UPDATING views table joins

    Date: 09/14/05 (SQL Server)    Keywords: asp, sql, microsoft

    Alright... imagine this scenario. Server 1 has two tables. Server 2 has views to server 1's two tables.

    From Server 2, you're attempting to execute an UPDATE on said views. (No, you cannot simply update server1 and the two tables directly, that's not an option so don't ask.) If you run a single UPDATE with a WHERE clause against view 1, it'll work fine.

    BUT if you add in an INNER JOIN constraint against view 2, instead of updating just the handful of records you wish to UPDATE , it'll UPDATE EVERYTHING!!!!

    Example:

    -- Server1
    CREATE TABLE tempOne (
    rowid int IDENTITY(1, 1),
    myvalue int
    )

    CREATE TABLE tempTwo (
    rowid int
    )

    -- Server2
    CREATE VIEW viewOne AS (SELECT * FROM server1...tempOne)

    CREATE VIEW viewTwo AS (SELECT * FROM server1...tempTwo)

    -- Insert 5 random values into tempOne then insert '2' and '4' into tempTwo, which will later be used as a constraint

    -- Server2
    -- This works just fine, should return rowid 2 and 4 of viewOne.
    SELECT *
    FROM viewOne t1
    INNER JOIN viewTwo t2
    ON t1.rowid = t2.rowid

    -- This is what does NOT work
    UPDATE viewOne
    SET myvalue = myvalue * -1
    FROM viewOne t1
    INNER JOIN viewTwo t2
    ON t1.rowid = t2.rowid

    Instead of rowid 2 and 4 being UPDATED, ALL 5 rows will be UDPATED. What GIVES?!?! I see via SQL Profiler that the query is sent from Server2 to Server1 and redefined there in a really messed up fashion. Am still trying to wrap my head around how I can rewrite this query. And no, I cannot not use the views and directly jump to Server1 because in my real scenario, it could be ServerX... I don't know until runtime, hence why we have the generic views.

    Help?

    --

    UPDATE: Alright, I've done some more digging and figured a few things out.

    First, this has NOTHING to do with views. The problem has to do with remote server UPDATE statements. I ran some more tests without views but with direct table references as a WHAT IF, and ran into the same results. But when I'd tweak the UPDATE statement slightly, I managed to generate a SQL Server error which I did a lookup on and found the following:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;814581

    Basically the table I'm updating in question, doesn't have any PKs or UNIQUE constraints on it. My basic example, that would be easy to toss in. However the actual Production table I'm dealing with does NOT have any PKs, nor can I enforce any (don't ask, makes me want to sob). In other words, I'm basically screwed.

    *sigh*

    Source: http://www.livejournal.com/community/sqlserver/33825.html

  5. error_log() problem

    Date: 09/14/05 (PHP Community)    Keywords: php, mysql, sql, google

    I have been trying to write a custom error handler (or at least adapt the one used in O'Reilly's PHP and MySQL book) and I'm encountering an issue with the error_log() php function. I'm not sure whether this is a problem in my configuration files or whether the function is being used incorrectly - I haven't altered this part of the code from the book. The code being called is:

    error_log($error, 3, ERROR_FILE);

    And it produces the following error message (file paths removed):

    Warning: error_log(...filepath.../log/php_error_log.log): failed to open stream: Invalid argument in ...filepath.../phpincludes/customHandler.inc on line 89

    If anyone can help me (I've spent hours trawling Google with no luck) it would be much appreciated.

    Life is tough when you can't debug your debugger...

    Source: http://www.livejournal.com/community/php/343526.html

  6. Mysql

    Date: 09/17/05 (MySQL Communtiy)    Keywords: php, mysql, software, database, sql, web

    Does anyone know how much one can expect to spend to hire someone to create a mysql/php script? The one in particular is for allowing a member to view online statements at a gym website and needless to say, quite secure. The software we use for gym management uses a mysql database. I've got to run this by my manager in two days so I'm looking for how much he can expect to spend and what is a good and reliable source to get this done. Thanks for any assistance. Trinity

    Source: http://www.livejournal.com/community/mysql/68184.html

  7. pseudo-code help

    Date: 09/18/05 (PHP Community)    Keywords: php, mysql, blogging, sql

    I'm making a threaded comments script for a blogging system. My code so far is not working, so I'm trying to think it through again using pseudo-code. I'd really appreciate some feedback on what I should be doing, if anyone would mind taking a look at the pseudo-code (under the cut). If my reasoning is correct, then I can concentrate on the syntax.


    MySQL tables:

    Posts (sorry for the yuck formatting)
    id year month day hour minute timestamp author title content images mood music

    Comments
    id (unique id) post (to which the comment belongs) parent (comment to which the comment is a reply) author title timestamp email homepage content

    Coding

    • have a script, PostsTable.php, to display a post or posts using a while loop, including a collapsible division to display comments or not as desired (easy - done that)
    • for each post, set the parent value, $parent_id, to 0 as part of the while loop
    • for each post, set the ID of the post, $post_id, from the array generated by the query used to get the post
    • within the comments division below each post, include a script, CommentsView.php, to run the queries to get comments
    • use a while loop in CommentsView.php to get all comments in order and in accordance with $parent_id and $post_id
    • for each comment, set its ID (within the loop) as $parent_id for looping through its replies later
    • if there are no comments for a particular post (or replies to a particular comment), end
    • if there are comments, include a script to display them similar in design to PostsTable.php: CommentsTable.php
    • CommentsTable.php includes CommentsView.php, until it ends


    Thank you in advance ^^

    Source: http://www.livejournal.com/community/php/344263.html

  8. Using SQL Server to validate mathematical equations on a Sat night!!!

    Date: 09/19/05 (SQL Server)    Keywords: sql



    What do smart people do on a Saturday night? Play Smath of course and argue over the validity of using parentheses in mathematical equations like this:

    12 = (7) + 5

    I still think it's completely valid, see SQL Server confirms it:

    SELECT (7) + 5
    --yields
    --12

    So after demonstrating that it was valid in SQL I was basically told that SQL Server is like retarded or something and like it doesn’t adhere to real mathematical principles?

    Any opinions out there? Is SQL Server math stupid, is there a real "math property" that supports this? Any opinionated mathematicians out there that can give some insight?

    Source: http://www.livejournal.com/community/sqlserver/34391.html

  9. SQL Server Remote Query issue...

    Date: 09/19/05 (SQL Server)    Keywords: database, sql

    Alright, here's the scenario. I have 65 million row table of zip codes... the table just has three columns: zip_cd varchar(10), lattitude, and longitude values. Zip_cd is varchar(10) because we have to store zip + plus 4 values in "xxxxx-xxxx" format... and no, my senior DBA has already overruled me adding two more numeric columns which would offer more optimized indexing. There's a clustered index on the zip_cd and we only ever run lookups on zip_cd, to get lat/long values.

    Anyway, we have one simple query as follows:

    --

    DECLARE @zip_cd varchar(10)
    SET @zip_cd = '60440-0001'

    IF EXISTS(SELECT zip_cd
    FROM serverX.databaseY.dbo.geodata
    WHERE zip_cd = @zip_cd)
    PRINT 'one'
    ELSE
    PRINT 'two'

    --

    Starting late last week, one of our servers running this query started taking forever and a day. Upon running it manually and checking the execution plan, I see that SQL Server, in all of its wisdom, decided to run the "SELECT zip_cd" portion WITHOUT the WHERE clause on the remote server, THEN apply a "filter" step for the WHERE clause. I attempted to replicate this on other servers and 2/3s of our other servers runs the query correctly, by sending everything to the remote server, whereas 2 other servers also just pull all 65 million rows down THEN filters it locally.

    So my question is this... how in the hell can I force SQL Server to run the query in one fashion, rather than another? I know about using table and query hints, but the problem is that this is a remote server scenario, which Query Analyzer was complaining that index hints won't work.

    Help?

    x-posted...

    Source: http://www.livejournal.com/community/sqlserver/34761.html

  10. Birthdays problem

    Date: 09/24/05 (PHP Community)    Keywords: php, mysql, database, sql, web

    I'm doing a web application with PHP and MySQL where members can enter their birthday on their profile. I've done a nice monthly calendar view, and I want to populate the calendar with members' birthdays.

    Can anyone advise me the best way of doing this? Obviously I don't want to do a database request for each day: "Does anybody have a birthday on this day?" - I think we can all guess that 30 database requests would be rather excessive for one page!!

    What I'd like to do is one database request to get all the birthdays for the month and then write it to a 2-dimensional array. Each row in the array will have the user's name, their userid (to link to their profile) and the day of the month which is their birthday. Then all I need do is ask the array if there's any birthdays when I'm writing out the days.

    The trouble is, I'm very unfamiliar with arrays and I'm not sure the best way to do this. Can anyone help?


    Update
    I've found a very useful function which is helping a lot:

    $birthdayquery = "SELECT ID, RealName, DOBDay from Users where DOBMonth = '$month'";
    $birthdays = mysql_query($birthdayquery);
    $arrayindex = 0;
    while ( $birthdayarray[$arrayindex++] = mysql_fetch_assoc($birthdays) );

    You can then do

    $arrayindex = 0;
    foreach ($birthdayarray as $value) {
    	if ($birthdayarray[$arrayindex]["DOBDay"] == $day) {
    		echo $birthdayarray[$arrayindex]["RealName"];
    		echo "'s birthday";
    	}
    	$arrayindex++;
    }


    I think this is going to work!

    Source: http://www.livejournal.com/community/php/346726.html

  11. Host for beta test site.

    Date: 09/24/05 (Web Development)    Keywords: php, mysql, sql, web, apache

    I'm looking for a cheap host which offers the following:


    1. MySQL 4 with InnoDB support

    2. PHP 4 with GD/Image manipulation module

    3. Apache mod_rewrite support



    I'm looking to set up a beta test website for an open source myspace/friendster clone that I'm working on called Appleseed (http://appleseed.sourceforge.net).

    Let me know if you have any suggestions.

    Update: I need SSH access, too.

    Source: http://www.livejournal.com/community/webdev/246550.html

  12. Converting time to seconds

    Date: 09/25/05 (PHP Community)    Keywords: php, sql

    Is there a simple function to convert time (hh:mm:ss) to seconds (or hours)?

    Basically I want to duplicate this SQL in PHP: sum(((TIME_TO_SEC(end_time) - TIME_TO_SEC(start_time))/3600) * rate)


    I've looked here but I dont think I see it.
    http://us2.php.net/manual/en/ref.datetime.php

    Source: http://www.livejournal.com/community/php/347080.html

  13. Introduction and question

    Date: 09/26/05 (PHP Community)    Keywords: php, mysql, html, database, sql

    Hi everyone! I've slowly been teaching myself php and mysql over the past few months, but it's slow going, and I tend to learn better from someone teaching me something than I do from a book. I finally got the bright idea today (after having been on LJ for how long? lol) to look for a php help community, and lo and behold, I find you! :D If anyone could help me, I'd be very appreciative.

    Here's the situation: I'm trying to build forms that will gather the information provided, check to make sure that everything necessary is included, and either redirect to an error page or a success page as needed. The html form looks like this (obviously without the spaces):

    < form action="add_entry.php" method="post">
    Subject: < input type="text" name="subject" />
    Text: < textarea rows=6 cols=60 name="text">< /textarea>
    < input type ="submit" name="add_entry" value="Add Entry" />
    < /form>

    add_entry.php looks like this (again, without the spaces):


    include('common.php');
    if(isset($formname) && $formname == 'add_entry'){
    if($subject != '' && $description != ''){
    $dbh=mysql_connect ($host, $user, $pass) or die
    ('I cannot connect to the database because I do not like you' . mysql_error());
    mysql_select_db ($database) or die('I could not find the database you are searching for');
    $query = "INSERT INTO journal
    SET dateadd = NOW(),
    subject = '$subject',
    message = '$description'";
    mysql_query($query);
    mysql_close($dbh);
    $redirect = 'success.html';
    }
    else{
    $redirect = 'error.html';
    }
    }
    else{
    $redirect = 'error.html';
    }

    < html>
    < head>
    < meta http-equiv="Refresh" content="1;url=< ?php echo $redirect ?>" />
    < /head>
    < /html>

    My problem is that it never seems to go through the mysql query and always redirects to the error page. I know that the query is good--I've checked it through phpMyAdmin--so I'm thinking it has something to do with the isset.

    Any help would be greatly appreciated! :D

    Source: http://www.livejournal.com/community/php/347463.html

  14. Разыскивается толковый разработчик БД (Санкт-Петербург)

    Date: 09/30/05 (MySQL Communtiy)    Keywords: sql, microsoft

    Компания, специализирующаяся на разработке управленческих аналитических систем, приглашает на работу разработчика баз данных

    Требования:
    знание и опыт работы с Microsoft SQL Server 2000;
    знание Access 2000, ADO, ADO. net.;
    преимуществом является владение OLAP технологией

    Обязанности:
    участие в проектировании и разработке автоматизированных систем управления для крупных предприятий.

    Условия:
    Условия, гарантированные Трудовым Кодексом;
    Комфортные условия работы;
    Льготное питание;
    Возможности карьерного и профессионального роста
    Заработная плата от $700

    Контактная информация:
    Имя: Воробьева Мария
    Телефон: (812) 335 42 80/ 8 901 306 54 15
    E-mail: maria.vorobyeva@splc.ru

    Source: http://www.livejournal.com/community/mysql/69244.html

  15. session variable help?

    Date: 10/04/05 (PHP Community)    Keywords: php, mysql, sql, web, shopping

    Context: I'm working on a bare-bones shopping cart system and am using a session variable $cart to store cart items. $cart is an associative array holding item_id => quantity. To add an item to the cart, I'm calling the page with a url variable ?new=xx where xx is the item id. If the item id exists in the array, am incrementing it. If it doesn't exist, I create it and set the quantity to 1. In theory, anyway.

    Problem: Adding a new item to the cart produces the expected results, but if the page is called immediately after without the url variable, or with a url variable pointing to a different id, it increments the quantity of the item just added by one. It is also the case that when I call a separate checkout page with the display_cart($cart) function in it, the item quantity shows up incremented by one.

    (the following code will look very familiar if you've ever used PHP and MySQL Web Development)


    On the shopping cart page:

    if($new)
    {
        if(!session_is_registered("cart"))
        {
            $cart = array();
            session_register("cart");
        }

        if($cart[$new])
             $cart[$new]++;
        else
            $cart[$new] = 1;
    }

    if($save) //have tried commenting out this part, makes no difference
    {
        foreach ($cart as $item_id => $qty)
        {
            if ($$item_id == "0")
                unset($cart[$item_id]);
            else
                $cart[$item_id] = $$item_id;
        }
    }

    if ($cart&&array_count_values($cart))
        display_cart($cart);
    else
        echo "There are no items in your cart.";


    Display cart function:

    function display_cart($cart)
    {
        echo "

    ";
        echo "";
        echo "";
        echo "";
        echo "";

        foreach($cart as $item_id => $qty)
        {
            $item = get_item_details($item_id);
            echo "";
        }

        echo "";
        echo "
        < td align = center >
        < input type = hidden name = save value = true >
        < input type = image src = \"images/save_changes.jpg\" border = 0 alt = \"Save Changes\">
        
        
        ";
        echo "
    item nameqtyprice
    ";
            echo $item['name'];
            echo "
    ";
            echo "";
            echo "
    ";
            echo $item['price'];
            echo "
    &nbsp;&nbsp;
    ";
        echo "
    ";
    }


    I've done a bit of reading on how sessions work, but am still pretty confused by it. Is this black magic or am I just not going about this right? Any suggestions, including debugging techniques, would be appreciated. In the meantime, I'm just going to take a whole different approach to this cart, but I'd like to solve the mystery eventually.

    Thanks in advance.

    Source: http://www.livejournal.com/community/php/350281.html

  16. Intellisense® style word completion

    Date: 10/05/05 (SQL Server)    Keywords: sql

    Intellisense® style word completion for MS Query Analyzer, VS.NET 2003, SQL Server Management Studio and VS 2005.

    http://www.promptsql.com/

    --

    This looks like a real slick tool, which would easily pay for itself after a day's use!

    (x-posted to various places)

    Source: http://www.livejournal.com/community/sqlserver/36137.html

  17. Intellisense® style word completion

    Date: 10/05/05 (IT Professionals)    Keywords: sql

    Intellisense® style word completion for MS Query Analyzer, VS.NET 2003, SQL Server Management Studio and VS 2005.

    http://www.promptsql.com/

    --

    This looks like a real slick tool, which would easily pay for itself after a day's use!

    (x-posted to various places)

    Source: http://www.livejournal.com/community/itprofessionals/24537.html

  18. DELETE query and not only

    Date: 10/06/05 (PHP Community)    Keywords: mysql, sql

    Do someone know what's wrong with the following code:

    //deleting
    if ($delete) {
            foreach ($record as $num) {
            $query=mysql_query ("DELETE FROM $table WHERE ID='$num'");
            }
            printf ("Records deleted: %d\n
    ", mysql_affected_rows($query));         }


    As you probobly can see, I need it to print how many rows were deleted and it returns 0 even when I"m 100% sure several rows were deleted.

    Source: http://www.livejournal.com/community/php/351399.html

  19. catas-apostrophe

    Date: 10/07/05 (Web Development)    Keywords: mysql, sql

    Quick Question:

    I'm feeling less than genius today, so I'm stumped as to why this is happening

    I've got a field I'm pulling from the mysql db.
    $name = stripslashes(urldecode(mysql_result($result, $row,'NAME')));

    If the db field contains "donkey%5C%27s" then $name echoes "donkey's"

    this looks fine when I plop it as text, but when I insert into a text INPUT field, like so:

    [input typ="text" name="name" value="[? echo $name; ?]"]

    it shows up as "donkey"

    the 's is chopped off in the text field why?

    edit : the problem was the [input... attributes were single quoted
    [input type='text' name='name' value='donkey's']

    doh.

    Source: http://www.livejournal.com/community/webdev/252293.html

  20. [Geek] reading excel into a web form

    Date: 10/10/05 (Web Development)    Keywords: database, sql, web

    I have been told we need to make a feature that will
    allow the user to upload an excel spreadsheet (this
    will always be formatted in the same was) to the server
    then on postback link to the spreadsheet and read the
    information from specific cells out into a web form
    which can be checked before submission by web form
    to the sql server database.

    I've never done this before i am fairly sure that i
    can connected to a excel spreadsheet as a datasource
    *hopes with fingers crossed* but can i specify individual
    cells to write from? how difficult is to specify which
    worksheet your wanting information from etc

    I am going to look into it on the web later but if anyone
    has any ideas or has done something similar i'd very
    much appreciate any help with this, I did in the past
    have to attempt connecting to a excel sheet which
    didn't go well.

    Source: http://www.livejournal.com/community/webdev/253462.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