');
while ($yarnarray = mysql_fetch_array ($listyarns)) {
printf ('');
printf ('');
$counter++;
if ($counter % 2 == 0) {
printf ("");
$counter = 10;
}
}
And the processing code:
$yarns = "SELECT yarnid FROM yarns";
$yarnidquery = mysql_query ($yarns) or die ("Error at Yarns " . mysql_error() . "\nWhole Query: " . $yarns);
$yarnarraysetup = mysql_fetch_array ($yarnidquery);
$yarnarray = $yarnarraysetup['yarnid'];
while ($yarnidlist = mysql_fetch_array ($yarnidquery)) {
if ($yarnidlist['yarnid'] == $_POST['$yarnarray']) {
//$yarnprice = "INSERT INTO prices (yarnid, storeid, price) VALUES ('$storeidset', $yarnidlist['yarnid'], $_POST['$yarnarray'])";
//$yarnpriceinsert = mysql_query ($yarnprice) or die ("Error at YarnPrice: " . mysql_error() . "\nWhole Query: " . $yarnprice);
}
}
Question 2:
Is there any way to pass variables through an <a href= > tag? I want to set up the ability to browse through stores without having to use all dropdown menus.

Thanks in advance for all of the help.

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

  • Dispaying all dated entries in a DB

    Date: 08/14/05 (PHP Community)    Keywords: mysql, database, sql

    I am trying to display a list of all entries in a blog database. Each entry has a date field, of MySQL type "date", but when I try to display all posts in the database, it only shows posts that have a date on or before the current date. Any post-dated entries do not show up.

    This is the query I am running on the database:

    SELECT * FROM `news` WHERE `date` <= '9999-12-31' ORDER BY `date` DESC, `id` DESC

    I have tried not using a "WHERE" attribute, and also tried "WHERE 1"

    Any suggestions?

    Solved! It was in my post display function. That'll teach me to not pay attention to subfunctions.

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

  • Ressource id #8

    Date: 08/16/05 (PHP Community)    Keywords: php, mysql, database, sql, google

    $query = "SELECT * FROM users WHERE username = '$username' LIMIT 1;";
    $result = mysql_query($query);
    if ($result) { 
     # deny this user // already in
    }
    else { 
     # add new user
    }
    

    $result ouputs "Ressource id #8." I tried different set of variables in case it could be the problem but everything echo with the correct values. What I'm looking for is: check into the database, if there a equal username already registered. Both tries [with an existant and an unexistant username], it returns the same error. I've looked around either google.com and php.net, it turned on hopeless.

    Can you help me out?

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

  • MS Access and Visual Basic

    Date: 08/17/05 (Code WTF)    Keywords: templates, mysql, sql, microsoft

    Hi. I'm trying to "beef up" one of the Access general templates for use, and I'm running into a problem.

    I'm using the "Contacts Management" template, and have added a field "ReferredBy" to the Contacts table. I was wanting to add this as a search item on the "Report Date Range" form, so that I can have a report organized not only by date but grouped by ReferredBy.

    I hope this makes sense, I am experienced with Access but not very experienced with Visual Basic. I've done a ton with MySQL, and thought this would be related. I guess I'm wrong... ;-)

    I've been able to add the ReferredBy to the Report Date Range form. However, I get an error:

    Run-time error '2465': Microsoft Access cannot find the field "|" referred to in your expression.

    The VBA for the Report Date Range looks like this:

    Private Sub Form_Open(Cancel As Integer)
    Me.Caption = Me.OpenArgs
    Me![Referred By] = [ReferredBy]
    Me![Beginning Call Date] = Date - Weekday(Date, 2) + 1
    Me![Ending Call Date] = Me![Beginning Call Date] + 6
    End Sub

    Everything works fine when I don't have the "Referredby" line in there, but it does nothing with that item... The way the code is now, it seems circular, but my brain can't figure out how to fix it.

    Please help. I am so frustrated and just looking for a little help, even just where I need to go to get help.

    Thank you!

    x-post in '[info]'sharonme

    Source: http://www.livejournal.com/community/code_wtf/13145.html

    1. 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

    2. 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

    3. 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

    4. 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

    5. 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

    6. Нужны люди с углубленным знанием Flash 2004 Pro

      Date: 07/26/05 (Algorithms)    Keywords: php, mysql, sql, java

      Сабж.Для создание многопользовательской игры на flash.
      Труд будем оплачивать. Можно удалённо. Знание Java и Php. Также очень желательно MySQL.

      Source: http://www.livejournal.com/community/algorithms/61549.html

    7. date range for the current week

      Date: 07/28/05 (PHP Community)    Keywords: mysql, sql

      how can i get the date range for the current week, from sunday to saturday? i.e., this week would be 24-30. i've tried playing around with a the date function but can't figure out how to do this. a mysql query would be ok, too.

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

    8. subquery question

      Date: 07/29/05 (MySQL Communtiy)    Keywords: mysql, sql, web, google

      I am trying to execute a delete using a subquery but I keep getting the same error and google and mysql.com are both no use as to what the error actually means

      My query is this

      delete from exon where exon_id in(select exon.exon_id from exon left join exon_transcript on exon.exon_id = exon_transcript.exon_id where exon_transcript.exon_id is NULL);


      and this is the error

      ERROR 1093 (HY000): You can't specify target table 'exon' for update in FROM clause

      do you have any ideas what I am doing wrong?

      exon_transcript is a table which links the exon table with another table called transcript and there were a series of rows missing from exon transcript so the links weren't present

      I have been able to use other methods to delete the links from transcript but I can't see any other way of deleting the links from exon

      if you want to see the schema description have a look here

      http://cvsweb.sanger.ac.uk/cgi-bin/cvsweb.cgi/ensembl/sql/table.sql?rev=1.229&view=log

      I am using this version of mysql

      mysql Ver 14.7 Distrib 4.1.12, for dec-osf5.1b (alphaev68) using readline 4.3

      thanks

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

    9. WOO!

      Date: 07/30/05 (Web Development)    Keywords: php, mysql, sql, web

      About a week ago I made a post asking for references on PHP because I had just interviewed for a job at a web design firm and my lack of PHP knowledge was one of the things holding me down. Well, like I said, I spent all weekend studying PHP (thanks for all the references everyone!) and tearing apart existing PHP scripts until I was able to write my own scripts without using any reference. By Tuesday I had written a blog system using PHP and MySQL (complete with login authentication using sessions, add, edit and delete entries, and add or remove posters on the system, plus much much more...which, I'm pretty sure you would agree is a pretty easy task, but having only started learning PHP three days prior, I'm quite proud of myself).

      Anyway, I went in for the second interview on Wednesday this week and showed them what I had accomplished over the four days between interviews.

      This morning I got a call from them offering the job to me :o) I start on the 15th.

      Anyway, I just wanted to thank everyone for hooking me up with the PHP references.

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

    10. WOO!

      Date: 07/30/05 (WebDesign)    Keywords: php, mysql, sql, web

      About a week ago I made a post asking for references on PHP because I had just interviewed for a job at a web design firm and my lack of PHP knowledge was one of the things holding me down. Well, like I said, I spent all weekend studying PHP (thanks for all the references everyone!) and tearing apart existing PHP scripts until I was able to write my own scripts without using any reference. By Tuesday I had written a blog system using PHP and MySQL (complete with login authentication using sessions, add, edit and delete entries, and add or remove posters on the system, plus much much more...which, I'm pretty sure you would agree is a pretty easy task, but having only started learning PHP three days prior, I'm quite proud of myself).

      Anyway, I went in for the second interview on Wednesday this week and showed them what I had accomplished over the four days between interviews.

      This morning I got a call from them offering the job to me :o) I start on the 15th.

      Anyway, I just wanted to thank everyone for hooking me up with the PHP references.

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

    11. Phat C# Database Tool

      Date: 08/02/05 (C Sharp)    Keywords: mysql, sql

      I am nearly done with a DB Tool for C# and MySQL. Please See My Entry for more details...

      Source: http://www.livejournal.com/community/csharp/32384.html

    12. Cheat Sheets

      Date: 08/05/05 (Web Development)    Keywords: php, mysql, css, xml, sql, java

      ILoveJackDaniels.com has some really great cheat sheets that you may find handy.



      He just added some javascript cheats which includes XMLHTTPRequest cheats, function cheats, etc.

      http://www.ilovejackdaniels.com/cheat-sheets/

      He has Javascript cheats, PHP cheats, RGB Hex Color chart, mySQL, CSS, mod_rewrite, regular expressions and others.

      x-posted to '[info]'itprofessionals.

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

    13. Cheat Sheets

      Date: 08/05/05 (IT Professionals)    Keywords: php, mysql, css, xml, sql, java, web

      ILoveJackDaniels.com has some really great cheat sheets that you may find handy.



      He just added some javascript cheats which includes XMLHTTPRequest cheats, function cheats, etc.

      http://www.ilovejackdaniels.com/cheat-sheets/

      He has Javascript cheats, PHP cheats, RGB Hex Color chart, mySQL, CSS, mod_rewrite, regular expressions and others.

      x-posted to '[info]'webdev.

      ps. Are any of you from the Bay Area?

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

    14. InnoDB

      Date: 08/05/05 (MySQL Communtiy)    Keywords: php, mysql, sql, web, apache

      hey guys, me again -

      i've got mysql 4.1.13a-nt running on win xp pro (apache and php4 as well, shouldn't be relevant tho) and I'm trying to set up and use InnoDB (for the foreign keys) - whenever I make a new table in EMS MySQL Manager or through the command-line utility and try to set it as InnoDB, when the table appears, it's always MyISAM

      I'm sure my MySQL Manager version supports InnoDB since it works when I create an InnoDB table on my webhost, it's only not working locally

      I did the InnoDB config on install of MySQL - is there anything else I have to set or enable to use InnoDB?

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

    15. loading descriptions under a full-size image run by JS?

      Date: 08/11/05 (Web Development)    Keywords: php, mysql, sql

      I posted in '[info]'php but no one has given me help yet. I'm x-posting here in hopes there is someone in here that isn't in '[info]'php that can help me. Here's my question.

      Uh... Is it possible to insert some sort of php echo to display descriptions under a picture?

      It's not the same as exif_read_data, because these pictures are my scanned artwork images, not photographs. I have been searching for some sort of script or explanation on how to do this, but can't find it so I'm asking here.

      This is the page in question:
      http://www.luckycatstudio.com/galleries/World/index.php

      The six thumbnails at the top, are scripted in JS for onClick action, on a php page (for php includes and date functions), to load the full sized image below the row of thumbnails. I want to add an area under each full-sized picture that will display a description of what the picture is about each time a picture is clicked on. I'm thinking something in php's echo function. But how would it get the description of the image if not an exif? Save the description in separate individual files? Embed the description in the image in my Photoshop 7's File Info option? Or iPhoto? Use MySql?

      Anyway, I'm fairly sure that there are better PHP codes for onClick loading and displaying full-size images with their descriptions.

      If anyone can help me, I'd greatly appreciate it.

      Thanks.

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

    16. PHP Question

      Date: 08/11/05 (PHP Community)    Keywords: php, mysql, sql

      Uh... Is it possible to insert some sort of php echo to display descriptions under a picture?

      It's not the same as exif_read_data, because these pictures are my scanned artwork images, not photographs. I have been searching for some sort of script or explanation on how to do this, but can't find it so I'm asking here.

      This is the page in question:
      http://www.luckycatstudio.com/galleries/World/index.php

      The six thumbnails at the top, are scripted in JS for onClick action, on a php page (for php includes and date functions), to load the full sized image below the row of thumbnails. I want to add an area under each full-sized picture that will display a description of what the picture is about each time a picture is clicked on. I'm thinking something in php's echo function. But how would it get the description of the image if not an exif? Save the description in separate individual files? Embed the description in the image in my Photoshop 7's File Info option? Or iPhoto? Use MySql?

      Anyway, I'm fairly sure that there are better PHP codes for onClick loading and displaying full-size images with their descriptions.

      If anyone can help me, I'd greatly appreciate it.

      Thanks.

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

    17. Two Questions

      Date: 08/13/05 (PHP Community)    Keywords: php, mysql, database, sql, web

      [Error: Irreparable invalid markup ('') in entry. Owner must fix manually. Raw contents below.]

      Hi everyone. I am new to the group, and also relatively new to PHP. I have two questions relating to a website that I am setting up. Brief description:
      This is a website that lists reviews of yarn stores. Included in the information that it captures is the price of certain yarns.
      Question 1:
      If I am using an array to call the &lt;input name = xyz&gt;, how do I write my insert statement to use it?
      This is what I have so far, but I am very skeptical that it would work:

      The form code:
      $dbh=mysql_connect ("host", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
      mysql_select_db ("knittin1_yarnstore");
      $getyarns = "SELECT yarnid, yarnco, yarnname FROM yarns";
      $listyarns = mysql_query ($getyarns) or die ("Error at ListYarns: " . mysql_error() . "\n Whole Query: " . $getyarns);
      $counter = 10;
      printf ('
    ' . $yarnarray['yarnco'] . " " . $yarnarray['yarnname'] . '$
    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