Re: [PHP-DB] TUDBC a new unified database API for PHP (Phalanger, Quercus), Ruby (IronRuby, JRuby), Java, C#, VB.NET, J#, and others

2008-09-13 Thread Evert Lammerts
Just so you are aware: TUDBC is not published under any of GNU's licenses. The website explains the terms and conditions, which are pretty tight. It does say there are no plans to commercialize TUDBC, but the terms are not at all comforting on that subject. I don't recommend building software that

Re: [PHP-DB] Delicious style Tags table

2008-09-12 Thread Evert Lammerts
> Evert Lammerts-2 wrote: >> >> Your 'taggings' table is basically a link table to deal with a 'many >> to many' relationship - i guess you know: >> >> You have a table A and a table B that have a many-to-many >> relationship, which is

Re: [PHP-DB] Delicious style Tags table

2008-09-11 Thread Evert Lammerts
Your 'taggings' table is basically a link table to deal with a 'many to many' relationship - i guess you know: You have a table A and a table B that have a many-to-many relationship, which is stored in table L. What query fetches all rows in A that relate to all members of the set [B1, B2, ..., Bn

Re: [PHP-DB] databases and XML

2008-09-09 Thread Evert Lammerts
XML handles hierarchical structuring of data, a relational database system handles relational structuring of data. Imho, usage of any of these methods depend on the requirements of the system to be built. That being said, I'm not sure what the real need would be for, like you say, a database only a

Re: [PHP-DB] Getting started with MDB2

2008-09-08 Thread Evert Lammerts
ame) values ($name, > $notes, $user)"; >$sql->query($qry); >return $sql->lastInsertID("List"); > > I'm now getting the following error message: Call to undefined method > SQL::lastInsertID() > > Any further clues? > > Yves > >

Re: [PHP-DB] Getting started with MDB2

2008-09-08 Thread Evert Lammerts
Here are some other options for escaping: http://pear.php.net/manual/en/package.database.mdb2.intro-quote.php I think getAfterId will not work - seems to be part of LiveUser Admin. Interesting stuff, definitely worth a look. On Mon, Sep 8, 2008 at 7:14 PM, YVES SUCAET <[EMAIL PROTECTED]> wrote:

Re: [PHP-DB] Getting started with MDB2

2008-09-08 Thread Evert Lammerts
> * mysql_last_insert_id() getAfterId() http://pear.php.net/reference/LiveUser_Admin-0.3.3/LiveUser_Admin/LiveUser_Admin_Storage_MDB2.html#methodgetAfterId > * mysql_real_escape_string() escape() http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Common.html#methodescape -- PHP Da

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
all of us do, it's subscribed to the list. i filter it out. On Mon, Sep 8, 2008 at 7:06 PM, Chris Hale <[EMAIL PROTECTED]> wrote: > Evert Lammerts wrote: >> >> My bad! Forgot the dollar signs This should work: >> function editproduct($item_id, $item_name, $item

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
Do a print on the query: >> function editproduct($item_id, $item_name, $item_desc, $item_price, >> $item_pix, $item_man_id, $item_cat_id) { >>$item_id = mysql_real_escape_string($item_id); >>$item_name = mysql_real_escape_string($item_name); >>$item_desc = mysql_real_escape

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
You need to run mysql_real_escape_string() on all of your input variables before using them: function editproduct($item_id, $item_name, $item_desc, $item_price, $item_pix, $item_man_id, $item_cat_id) { $item_id = mysql_real_escape_string($item_id); $item_name = mysql_real_escape_st

Re: [PHP-DB] mysql auto_increment

2008-09-07 Thread Evert Lammerts
Little change - the label was not used in the right way: http://pastebin.com/m2d98e677 On Sun, Sep 7, 2008 at 11:46 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote: > I guess this code was not copy pasted from your actual source? It > would generate mysql errors. > > Anyway, I thi

Re: [PHP-DB] mysql auto_increment

2008-09-07 Thread Evert Lammerts
Pastebin is so much nicer when posting code. Find the code i've sent here: http://pastebin.com/mc5d611a -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql auto_increment

2008-09-07 Thread Evert Lammerts
I guess this code was not copy pasted from your actual source? It would generate mysql errors. Anyway, I think I've an idea of what you want, so here's my two cents : function edit_cat_radio($item_cat_id) { connect(); $query = mysql_query("SELECT * FROM cat"); while ($row

Re: [PHP-DB] If( Query)

2008-09-07 Thread Evert Lammerts
Is your table set up in the same way on your webserver? Maybe you forgot to set the default value to na.gif in your item_pix column. If not, can you send your table definition? On Sat, Sep 6, 2008 at 9:02 PM, Chris Hale <[EMAIL PROTECTED]> wrote: > I have the following function: > > function > add

Re: [PHP-DB] Import Excel sheet into SQL

2008-09-05 Thread Evert Lammerts
wrote: > Hi Evert, > > I have attached it again. > > > Regards, > > Nasreen > > - Original Message > From: Evert Lammerts <[EMAIL PROTECTED]> > To: Nasreen Laghari <[EMAIL PROTECTED]> > Sent: Friday, September 5, 2008 11:03:18 AM > Subject:

Re: [PHP-DB] CMS-Blog system

2008-09-03 Thread Evert Lammerts
> 1) having separate databases for each blog = fast > (problem: what if I will need to do search in all of the blogs for some > article?) > > 2) having all blogs in one database - that might be 10 000 * 100 articles = > too many rows, but easy to search and maintain, hmm? The answers on your quest

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
nt, >> >>David DURIEUX >>Tel : 04.74.04.81.34 >>Port : 06.34.99.45.18 >>Mail : [EMAIL PROTECTED] >>Site Web : http://www.siprossii.com/ >> >>SIPROSSII >>847 route de Frans (Créacité) >>69400 Villefranche sur Saône >> >> >

Re: [PHP-DB] Blank Page?

2008-09-03 Thread Evert Lammerts
>switch($_GET[page]) > { > connect(); > case "about" : Put the connect() before the switch (and keep error_reporting(E_ALL) at the top): connect(); switch($_GET[page]) { case "about" : } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

Re: [PHP-DB] Blank Page?

2008-09-03 Thread Evert Lammerts
Add the line: error_reporting(E_ALL); at the top of your functions page On Wed, Sep 3, 2008 at 9:29 PM, Chris Hale <[EMAIL PROTECTED]> wrote: > I have a functions page: > function connect() > { > include("includes/Vars.php"); > mysql_connect($host, $user, $passwd) or die("Couldn't connect to

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> Your SELECT has a terminating semicolon. I'm guessing Multiple statement execution is enabled by default... http://dev.mysql.com/doc/refman/5.0/en/mysql-query.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
; Tel : 04.74.04.81.34 > Port : 06.34.99.45.18 > Mail : [EMAIL PROTECTED] > Site Web : http://www.siprossii.com/ > > SIPROSSII > 847 route de Frans (Créacité) > 69400 Villefranche sur Saône > > > > Le Wed, 3 Sep 2008 20:51:49 +0200 > "Evert Lammerts" <

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
lefranche sur Saône > > > > Le Wed, 3 Sep 2008 20:43:25 +0200 > "Evert Lammerts" <[EMAIL PROTECTED]> a écrit: > >>Are you still using the code we talked about? >> >>if ($row = mysql_fetch_assoc($query)) { >> var_dump ($row); >>

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
vid DURIEUX > Tel : 04.74.04.81.34 > Port : 06.34.99.45.18 > Mail : [EMAIL PROTECTED] > Site Web : http://www.siprossii.com/ > > SIPROSSII > 847 route de Frans (Créacité) > 69400 Villefranche sur Saône > > > > Le Wed, 3 Sep 2008 20:05:22 +0200 > "Evert Lammerts

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote: > On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy <[EMAIL PROTECTED]> wrote: >> When using mysql_query, the SQL string to be executed should not end >> in a semicolon. > > Ending a query with a

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy <[EMAIL PROTECTED]> wrote: > When using mysql_query, the SQL string to be executed should not end > in a semicolon. Ending a query with a semicolon should not be a problem - the string is parsed by the mysql server, which handles it fine. -- PHP Database M

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> Humm with this query I have forgotten to tell you the ID is DELETED You mean the record with id=134? > Are you sur it is 3 ? it is 134 no? You're right :-) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> string(3) "134" int(0) This means you're trying to delete the entry with id=3, and that it cannot find that in the database. Are you sure it exists? We tried the queries separately and the SELECT had no problem... SELECT * FROM table WHERE id=3; -- PHP Database Mailing List (http://www.php.net

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> I have : > > array(2) { ["module"]=> string(12) "sousdomaines" ["deleteid"]=> > string(3) "134" } > > But the ID is not deleted in mysql. That seems to be your var_dump($_GET), which means that either if (isset($_GET['deleteid'])) evaluates to FALSE or your SELECT does not return results. Let's

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> Cordialement, > > David DURIEUX > Tel : 04.74.04.81.34 > Port : 06.34.99.45.18 > Mail : [EMAIL PROTECTED] > Site Web : http://www.siprossii.com/ > > SIPROSSII > 847 route de Frans (Créacité) > 69400 Villefranche sur Saône > > > > Le Wed, 3 Sep 2008 12:54:19 +02

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
gt; > David DURIEUX > Tel : 04.74.04.81.34 > Port : 06.34.99.45.18 > Mail : [EMAIL PROTECTED] > Site Web : http://www.siprossii.com/ > > SIPROSSII > 847 route de Frans (Créacité) > 69400 Villefranche sur Saône > > > > Le Wed, 3 Sep 2008 12:39:45 +0200 > "E

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
0001/Web_data/hebergement/pages/sousdomaines.php >>> on line 7 string(0) "" NULL >>> >>> Warning: Wrong parameter count for mysql_num_rows() >>> in /usr/home/sites/CL01/Web_data/hebergement/pages/sousdomaines.php >>> on line 12 string(0) &qu

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
nt for mysql_num_rows() > in /usr/home/sites/CL01/Web_data/hebergement/pages/sousdomaines.php > on line 16 string(0) "" NULL > > > > Le Wed, 3 Sep 2008 12:11:00 +0200 > "Evert Lammerts" <[EMAIL PROTECTED]> a écrit: > >>> In fact the firs

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> In fact the first return 0 results So the problem is in your select, and if your select works when you manually insert the value for id (iow, without using $var), the problem has something to do with $var. Is the data type of the ID column INT? Try the following and let us know the output: $va

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> string(40) "SELECT * FROM table WHERE id=107 " > string(3) "107" And this query works when you run it on the database directly? Id 107 exists? Assuming that that's both so we're running out of options. After the select, can you do a print of mysql_error() and of mysql_num_rows()? -- PHP Data

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
>>If that doesn't work then var_dump($sql, $var) and write us the >>result. Also let us know the data type of the ID column. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
p://www.siprossii.com/ > > SIPROSSII > 847 route de Frans (Créacité) > 69400 Villefranche sur Saône > > > > Le Wed, 3 Sep 2008 11:13:11 +0200 > "Evert Lammerts" <[EMAIL PROTECTED]> a écrit: > >>> $sql = 'SELECT * FROM table WHERE i

Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Evert Lammerts
> $sql = 'SELECT * FROM table WHERE id="'.$var.'" '; > $req = mysql_query($sql) or die('Erreur SQL > !'.$sql.''.mysql_error()); > while($data = mysql_fetch_assoc($req)) { > echo $data['id']; > } > $sql2 = 'DELETE FROM table WHERE id="'.$var.'" '; > $req2 = mysql_query($sql2) or die('Erreur SQL > !

Re: [PHP-DB] OCI8 , PHP and APACHE issue

2008-09-01 Thread Evert Lammerts
apache > being unable to start at all. > > Than I remembered that on this particular machine we were running as a > different user and not local system. When I changed that it worked ok > > I really need to understand more about windows I guess > > Jack > > -Ori

Re: [PHP-DB] OCI8 , PHP and APACHE issue

2008-09-01 Thread Evert Lammerts
No interesting entries in the logs? On Mon, Sep 1, 2008 at 2:27 PM, Jack van Zanen <[EMAIL PROTECTED]> wrote: > I have the phpinidir directive set in apache so it loads the exact same > php.ini as the cli > > Jack > > 2008/9/1 Evert Lammerts <[EMAIL PROTECTED]> &g

Re: [PHP-DB] OCI8 , PHP and APACHE issue

2008-09-01 Thread Evert Lammerts
ical. > > Oracle 10.2.0.4 client > apache 2.2 > php 5.2.6 > > Thanks > > > On 01/09/2008, Evert Lammerts <[EMAIL PROTECTED]> wrote: >> >> Can you send your and the output of phpinfo when run from the command >> line and when run from the brows

Re: [PHP-DB] OCI8 , PHP and APACHE issue

2008-09-01 Thread Evert Lammerts
Can you send your and the output of phpinfo when run from the command line and when run from the browser? On Mon, Sep 1, 2008 at 6:35 AM, Jack van Zanen <[EMAIL PROTECTED]> wrote: > Hi List, > > > I have installed Oracle, PHP and apache on my windows machine and have the > following issue > > If I

Re: [PHP-DB] Adding 's

2008-09-01 Thread Evert Lammerts
$loopsize = mysql_num_rows(); $anagram = ""; for ($i = 0; $i < $loopsize; $i++) { $cell = mysql_result($anagram_result, $i, "anagram"); $anagram .= "" . $cell{0} . "" . substr($cell, 1) . "\n"; } On Mon, Sep 1, 2008 at 2:09 AM, Ron Piggott <[EMAIL PROTECTED]> wrote: > I have the following save

Re: [PHP-DB] Problem after moving servers

2008-08-31 Thread Evert Lammerts
I'm pretty sure I found the problem - I should've spotted it earlier. The function ProfileList::render gets a reference to the $db object by its parameter &$db. While you loop over your results, you pass the reference on to $this->des->load. I'm guessing that the definition of $this->des->load is

Re: [PHP-DB] Problem after moving servers

2008-08-31 Thread Evert Lammerts
ut. Anybody can drop your database, so do fix it! On 8/31/08, Gav <[EMAIL PROTECTED]> wrote: > On Sun, Aug 31, 2008 at 9:27 PM, Evert Lammerts > <[EMAIL PROTECTED]>wrote: > >> You don't need to print the query anymore - I already did that. You >> nee

Re: [PHP-DB] Problem after moving servers

2008-08-31 Thread Evert Lammerts
on the database and see what the result is? Also check if you get an error after setting error_reporting to E_ALL. On Sun, Aug 31, 2008 at 1:16 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote: > The code you've sent seems to be fine, and if I check your website it > does everything it

Re: [PHP-DB] Problem after moving servers

2008-08-31 Thread Evert Lammerts
The code you've sent seems to be fine, and if I check your website it does everything it should do in terms of filtering - if I select Tayside as a region I get a development company with the region set to Tayside. It seems to me that this means the problem is not in one of the subclasses of Profil

Re: [PHP-DB] Problem after moving servers

2008-08-31 Thread Evert Lammerts
Can you send over the function ProfileList::render? And you should make sure that whenever the render() function of one of ProfileList's subclasses is called, the value of $count is 30... It seems the most likely source of your problem to me. To check the value of $count you can do and echo $count;

Re: [PHP-DB] Problem after moving servers

2008-08-31 Thread Evert Lammerts
> $list->render( $db, $start, COUNT ); Send the code of this function and tell me the value of COUNT. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mySQL SELECT query

2008-08-29 Thread Evert Lammerts
In the SQL standard this would be AND NOT ministry_directory.listing_approved=0 AND NOT ministry_directory.listing_approved=4 MySQL supports (and there are probably more RDBs that do): AND ministry_directory.listing_approved!=0 AND ministry_directory.listing_approved!=4 On Fri, Aug 29, 2008 at

Re: [PHP-DB] Problem with updating MySQL table

2008-08-27 Thread Evert Lammerts
> Putting commands into input containers in HTML is deprecated in the > XHTML specification. You should use this instead in the input: Only if your doctype is XHTML, in which case you should also close every tag, including the input tag. If your doctype is HTML your code is fine. I use the HTML v

Re: [PHP-DB] Problem with updating MySQL table

2008-08-27 Thread Evert Lammerts
Everybody seems to agree on escaping :-) And I'm learning! HEREDOC, nifty indeed! How about your $_POST variable, is there anything in there? On Wed, Aug 27, 2008 at 6:38 PM, Jason Pruim <[EMAIL PROTECTED]> wrote: > > On Aug 27, 2008, at 12:24 PM, Evert Lammerts wrote: > >

Re: [PHP-DB] Problem with updating MySQL table

2008-08-27 Thread Evert Lammerts
Your index.php looks very strange: > > > > > > ?> I'm guessing you're echoing this? I never echo from my scripts so I don't know if this is new functionality, but in my days you echoed either by or by . Anyway, since you're using the $_POST variable, did you check if it contains any val

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
Forget my last mail. Good to hear it's solved. On Wed, Aug 20, 2008 at 1:20 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote: > Can you post the code you're using when you get the timeout? > > I guess you already tried to do a select only and an update only to > check if

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
lic_html/willowtreecrafts/seweblink/seinvaudit.php on lin > which was a permissions error on the folder, > now i'm timing out and getting nothing, > Sorry to have such a basic problem! > On 20 Aug 2008, at 11:45, Evert Lammerts wrote: > > What happens if you try the UPDATE

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
vaudit.php on lin > Sorry to have such a basic problem! > On 20 Aug 2008, at 11:45, Evert Lammerts wrote: > > What happens if you try the UPDATE before a SELECT? > > $sesdb = new PDO('sqlite:file.sqlite3'); > var_dump($sesdb->exec("UPDATE ZITEM SET ZQUANTIT

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
SET ZQUANTITY=0 WHERE ZPRODUCTID=bli-343"; > var_dump($sesdb->exec("UPDATE ZITEM SET ZQUANTITY=0 WHERE > ZPRODUCTID=bli-343")); > $sesdb->exec($sql); > var_dump($sesdb->exec("UPDATE ZITEM SET ZQUANTITY=0 WHERE > ZPRODUCTID=bli-343")); > $query=

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
What happens if you try the UPDATE before a SELECT? $sesdb = new PDO('sqlite:file.sqlite3'); var_dump($sesdb->exec("UPDATE ZITEM SET ZQUANTITY=0 WHERE ZPRODUCTID=1")); On Wed, Aug 20, 2008 at 12:42 PM, Evert Lammerts <[EMAIL PROTECTED]> wrote: > Sorry, I'm

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
ZPRODUCTID={$prodid}"; > $sesdb->exec($sql); > > On 20 Aug 2008, at 11:10, Evert Lammerts wrote: > > A little time on google told me that if you want to do a write after a > read (or the other way around) you need to free up the query resource > - apparent

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
sql = "UPDATE ZITEM SET ZQUANTITY='0' WHERE ZPRODUCTID={$prodid}"; > > $sesdb->exec($sql); > > } > > On 20 Aug 2008, at 09:59, Evert Lammerts wrote: > >>> $sql = "UPDATE ZITEM SET ZQUANTITY='0' WHERE ZPRODUCTID='".$prodi

Re: [PHP-DB] Sqlite 3 pdo update query problem

2008-08-20 Thread Evert Lammerts
> $sql = "UPDATE ZITEM SET ZQUANTITY='0' WHERE ZPRODUCTID='".$prodid."'"; Try to unquote $prodid: $sql = "UPDATE ZITEM SET ZQUANTITY='0' WHERE ZPRODUCTID={$prodid}"; Evert -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] using multiple apache

2008-08-15 Thread Evert Lammerts
You can set a save handler for the session and save the session to the database (http://php.net/session_set_save_handler). But it will be hard for server 2 to find out which data belongs to a user that just came from server 1 - you can't rely on a session id found in the url or in a cookie since...

Re: [PHP-DB] mathematical discrepancies

2008-08-14 Thread Evert Lammerts
Check http://php.net/manual/en/language.types.float.php Quote: Warning Floating point precision It is typical that simple decimal fractions like 0.1 or 0.7 cannot be converted into their internal binary counterparts without a small loss of precision. This can lead to confusing results: for examp

Re: [PHP-DB] RE: [PHP] If Column Exists

2008-08-13 Thread Evert Lammerts
SHOW COLUMNS FROM tablename; Also check http://dev.mysql.com/doc/refman/5.0/en/ On Wed, Aug 13, 2008 at 3:02 PM, Simcha <[EMAIL PROTECTED]> wrote: > You can try 'select `testcol` from `table`' and then check if you got a > mysql_error(). > > > > -Original Message- > From: Robin Vickery [m

Re: [PHP-DB] I want to remove the last comma

2008-08-12 Thread Evert Lammerts
JSON does the trick for you (www.json.org), and PHP's glob() gets rid of your readdir() overhead (you'll need PHP 5.2 or later for this): $path = "/path/to/images/"; $images = glob($path . "{*.jpg,*.gif,*.png}", GLOB_BRACE); for ($i = 0; $i < sizeof($images); $i++) $images[$i] = array($images[

Re: [PHP-DB] mysql_connect(): Lost connection to MySQL server during query

2008-08-12 Thread Evert Lammerts
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html should get you started. Good luck! On Tue, Aug 12, 2008 at 8:27 AM, Manoj Singh <[EMAIL PROTECTED]> wrote: > Hello all, > I am getting this error when connecting to the database through > mysql_connect function. > > Error: mysql_connect() [ hre

Re: [PHP-DB] $_SESSION issues - possible security hole?

2008-08-10 Thread Evert Lammerts
> Why use extract()? Try commenting it out... apart from it being If you use 'register globals' there's a good chance that a variable $rights exists because it's a key in your $_SESSION array (don't shoot me if I'm wrong, I've never worked with 'register globals'). By using extract() without the $

Re: [PHP-DB] $_SESSION issues - possible security hole?

2008-08-10 Thread Evert Lammerts
If it changes the value of $_SESSION['rights'], then how come if ($_SESSION['rights'] != "super") on line 14 doesn't exit()? Or does that happen when you hit refresh the second time? Or does the user it changes to also have 'super' rights? Why use extract()? Try commenting it out... apart from it

Re: [PHP-DB] Formatting output with json_encode

2008-07-14 Thread Evert Lammerts
Check out http://www.json.org/ for JSON structures. In javascript an Array object is a special implementation of the Object object (like all objects other than Object) - an Array object can only have numerical indices, an Object object can have textual indices too. If you json_encode a php array w

Re: [PHP-DB] Apache crashes every time I call mysqli_fetch_assoc()

2008-07-09 Thread Evert Lammerts
Check out your system's logs / event viewer. If apache crashes (how do you notice?) there should be some indication of the reason. Evert On Thu, Jul 10, 2008 at 2:24 AM, Chris <[EMAIL PROTECTED]> wrote: > Bonger O wrote: >> Hi, >> >> I have set up an environment on my Vista laptop comprising of A

Re: [PHP-DB] One field or a new table?

2008-06-21 Thread Evert Lammerts
e was wrong, I'd sure like to know, because that would make my > development work much easier. > > Jeff. > > > Evert Lammerts wrote: > > Whenever you can say: > > "X has zero or more Y" and "Y has zero or more X" you're talking about

Re: [PHP-DB] One field or a new table?

2008-06-20 Thread Evert Lammerts
Whenever you can say: "X has zero or more Y" and "Y has zero or more X" you're talking about a "Many to Many" relationship between X and Y, and you need a link table with foreign key constraints. Example: Table X: id name 1 A 2 B 3 C Table Y: id name 1 K 2 L 3 M Linktable: X_id Y_i

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-20 Thread Evert Lammerts
I should've checked the assumption. A little strange though for a scripting language. I'd say, since default behaviour of mysql_* functions is to assume the last opened link when a parameter is not passed, and since default behaviour is to evaluate null, false and 0 the same, mysql_* functions sho

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-19 Thread Evert Lammerts
What you said wasn't wrong - you'd just produce a couple of warnings. By taking away the assignment of the $link variable you're unsetting it, meaning it will have a value equal to NULL. All of the following should work. [old code] if (!($link = mysql_connect($a, $b, $c))) return; if (!mysql_sele

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-18 Thread Evert Lammerts
Pastebin works lots better when you're posting code: www.pastebin.com I don't see your database.php included in both of these modules. Where do you include it? EVert On Wed, Jun 18, 2008 at 9:38 PM, bateivan <[EMAIL PROTECTED]> wrote: > > Hello, > > To answer these qwestions: > 1. I am using "in

[PHP-DB] Re: [EMAIL PROTECTED] PHP/MySQL and COUNT() problem

2008-04-26 Thread Evert Lammerts
I've forwarded this msg to the php-db list (php-db@lists.php.net). Try to subscribe to it. The mysql extension for php is only an interface between php and mysql - the parsing of queries is done within mysql itself. So if your query works through CLI it will also work from within php. Try to v

Re: [PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Evert Lammerts
of columns do i need to do following in php /while ($row = mysql_fetch_array($result)) {/ /$sub= $row[venue].[vname];/ /}/ Regards - Original Message From: Evert Lammerts <[EMAIL PROTECTED]> To: Nasreen Laghari <[EMAIL PROTECTED]> Cc: php-db@lists.php.net Sent

Re: [PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Evert Lammerts
SELECT * FROM gig LEFT JOIN genre ON gig.genreId = genre.genreId LEFT JOIN venue ON gig.venueID = venue.vid WHERE gig.gigid = $gigdetail I'd replace the dash with [table].[columnames]. Also, you're using four different naming conventions in your columns - gigid, genreId, venueID and vid. If I w

[PHP-DB] Re: Some nestled calculation

2008-04-12 Thread Evert Lammerts
Freedom All I want to do is to know who bring who? On Sat, Apr 12, 2008 at 4:41 PM, Evert Lammerts <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: Something like this should work. $today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));

Re: [PHP-DB] Date calculation from MySql table

2008-04-12 Thread Evert Lammerts
Something like this should work. $today = mktime(0, 0, 0, date("m"), date("d"), date("Y")); $tomorrow = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y")); $sql = "SELECT COUNT(*) FROM table WHERE regdate BETWEEN {$today} AND {$tomorrow}"; $thismonth = mktime(0, 0, 0, date("m"), 1, date("Y")

Re: [PHP-DB] mysql_num_rows, resource id #

2008-03-27 Thread Evert Lammerts
Richard Dunne wrote: In my code below, I am trying to verify that the query is selecting data from both rows of my answers table. I have run the query on my MySQL CLI and getting answers from both rows, but running this script I get $rows = 0. I can't figure out why its not returning 2 for the n

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Evert Lammerts
The semi-colon is gone, although I didn't even notice it! I am using two different queries, one for count and the other to access the data itself. After running mysql_fetch_assoc, is foreach ok for accessing array members, or is there a more subtle approach? So it's working now? If it is, yo

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Evert Lammerts
Tried that as well and got the same result. I tried "Select count(answer) as total from answers where studentID='A123456789'"; from the CLI and got total = 2 as a result. So, we got rid of the Invalid Resource error and we know that the student id you use occurs in both rows in your tabl

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Evert Lammerts
OK. Tried that and count comes back as 1. So your query returns only one record. Try $query ="Select answer from answers"; -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Evert Lammerts
This is my code. The only error is at line 15 as I stated above. 1 Turn line 13 into $result = mysql_query($query) or die(mysql_error()); , so leave out the connection parameter and append the die() function, and see what error that produces. -- PHP Database Mailing List (http://www.

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Evert Lammerts
PHP is telling me that the resource I am using for mysql_fetch_assoc is invalid: $query ="Select answer from answers where studentID ='A123456789'"; $result = mysql_query($query,$connection); $count=0; while($row = mysql_fetch_assoc($result)); { $count++; } echo $count; Are you sure your d

Re: [PHP-DB] numeric string to single digit array

2008-03-26 Thread Evert Lammerts
I ran this $query ="Select answer from answers where studentID ='A123456789'"; $result = mysql_query($query,$connection); $resultArray = str_split($result,1); $count = count($resultArray); Where's the fetch? |$result = mysql_query("SELECT answer FROM answers WHERE studentID = 'A123456789

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Evert Lammerts
Correction: Also, this condition: [quote] if (!isset($_POST['txtLoginName']) || empty($_POST['txtLoginName'])) [/quote] is true if and only if no form element by the name txtLoginName existed on the previous page - and on top of that, empty() does the same as isset() and apart from that als

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Evert Lammerts
I might be way off here. Php.net tells me that: [quote] mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement string **mysql_real_escape_string** ( string $unescaped_string [, resource $link_identifier ] ) [/quote] and you use [quote] mysqli_real_e

Re: [PHP-DB] Retreving X, Y, Z from the Geometry column in oracle 10g

2008-02-20 Thread Evert Lammerts
You'll need an oracle - oci8 expert for this. A little googling told me that in order to use user defined data types (and i guess enhanced build in data types as GEOMETRY too) you will need oci8 functions (http://bugs.php.net/bug.php?id=39887), specifically the function bind_array_by_name() (h

Re: [PHP-DB] Formatting in Text Area

2008-02-01 Thread Evert Lammerts
VanBuskirk, Patricia wrote: I have a "customer description" text area field on my form which feeds through php to FMP, What's FMP? Is that what links this email to the db-list? and spits out a confirmation page and email. The issue I am having is this ... as the customer types, the text wra

Re: [PHP-DB] Efficient way to access MS SQL server

2008-02-01 Thread Evert Lammerts
There's a limit of 30 characters for column names, but only if you connect to your mssql server from windows (more info on http://hu2.php.net/mssql). The native SQL driver for PHP has a problem with a limit on the number of characters in a string, so can't use that. I'm not sure what Charly m

[PHP-DB] Don komo

2008-01-31 Thread Evert Lammerts
A quick google shows I'm not the first to ask this question... Lets take the address of the list? (I cc'ed owner) OWNER: Please take [EMAIL PROTECTED] from the php-db list. It's a google group email address that doesn't accept anonymous emails (if I've decrypted the indonesian well) and automa

[PHP-DB] [Fwd: Kesalahan posting: Don Komo]

2008-01-31 Thread Evert Lammerts
Is anybody else getting similar emails after sending an email to the php-db list? I don't understand any of this 2006 google group with 5 members. Original Message Subject:Kesalahan posting: Don Komo Date: Thu, 31 Jan 2008 09:17:40 + From: [EMAIL PROTECTED] To:

Re: [PHP-DB] A little SQL help

2008-01-31 Thread Evert Lammerts
Not completely sure what type of result you expect, but here's one that makes sense to me. SELECT tour.record_id, tour.event_start_date, tour.event_end_date, tour.event_name, angler_results.result FROM tour LEFT JOIN angler_results ON angler_results.tour_id = tour.record_id AND angler_results.a

Re: [PHP-DB] Webservices with PHP

2008-01-09 Thread Evert Lammerts
SOAP stands for Simple Object Access Protocol and is, as its name implies, a protocol for accessing objects or in other words, a standard that defines how a possibly remote object can be communicated with. XML-RPC, with RPC standing for Remote Procedure Call, is a protocol to call remote proced

Re: [PHP-DB] Beginners Problem

2008-01-08 Thread Evert Lammerts
Hi Ben, Number of things wrong with your code, look below. $select_sql = sprintf("SELECT `username` FROM `users` WHERE `username` = '$user' AND `password` = '$pass'", mysql_real_escape_string($user), mysql_real_escape_string($pass)); In the string you are printing using sprintf you need to u

Re: [PHP-DB] rtrim a string with MySQL's function

2007-12-05 Thread Evert Lammerts
You can use regular expressions in mysql to check for the right format, but (as far as i know) you can not return any matches: SELECT * FROM table WHERE column REGEX '[0-9]+';, which returns all records where column has a digit in its value. In PHP however, you can easily get the matches: $var

RE: [PHP-DB] Interactive Order Form

2007-11-09 Thread Evert Lammerts
I've never worked with FileMaker before, but a quick Google (http://www.filemaker.com/support/technologies/php.html) tells me you need to get a copy of the FileMaker API for PHP, if you're not using Windows that is. If you are using Windows you can use ODBC (http://www.filemaker.com/help/15-Using%2

[PHP-DB] tree processing

2007-10-30 Thread Evert Lammerts
one to have problems with processing big amounts of data in tree structures. Do you guys have any suggestions? Thanks, Evert Lammerts