You are here: Re: Is this a bug ? « All PHP « IT news, forums, messages
Re: Is this a bug ?

Posted by robert on 05/03/06 05:24

| I posted the new thread after I had received your reply asking for the
| details sorry.

no big. no need for sorries.

| The example I posted was a trivial example which illustrates the scenario
| however the real stored procedure is more complex.
| I would prefer to keep the sql within a sp if possible.

it should be fine to keep all your sql in the sp. i take it that this
simplified example you posted doesn't return the insert_id either...right?
the more complex one is ultimately performing an insert...right? updates
return a insert_id too. well...lol...supposed to. we have to get there
first.

| p.s. Nice choice of city !!!

you know i'm braindead! i just grabbed this example off the net and gave it
a shot on my pc with as little modification as possible. granted, i do know
where stuttgart is...but i can guarantee you, i couldn't spell it to save my
life. ;^) i suppose brisbane would have garnered a more picturesque
ambiance. ;^)

|
| >
| > ===========
| >
| > <?php
| > $link = mysqli_connect("localhost", "my_user", "my_password", "world");
| >
| > /* check connection */
| > if (mysqli_connect_errno()) {
| > printf("Connect failed: %s\n", mysqli_connect_error());
| > exit();
| > }
| >
| > mysqli_query($link, "CREATE TABLE myCity LIKE City");
| >
| > $query = "INSERT INTO myCity VALUES (NULL, 'Stuttgart', 'DEU',
| > 'Stuttgart',
| > 617000)";
| > mysqli_query($link, $query);
| >
| > printf ("New Record has id %d.\n", mysqli_insert_id($link));
| >
| > /* drop table */
| > mysqli_query($link, "DROP TABLE myCity");
| >
| > /* close connection */
| > mysqli_close($link);
| > ?>
| >
| >
| > ===========
| >
| > the "myCity" table has to be made from scratch...but you could
substitute
| > it
| > w/ your own. what we're trying to do here is just get *something* to
work.
| > once that happens, we can introduce new factors until it no longer
| > works...i
| > suspect it may be with the binding.
| >
| > i'm not sure if they name bugs after people...but you're welcome to it.
| > ;^)
| > and, there have been several bugs in the past related to the insert_id.
| > once
| > reported, they are fixed promptly. we just have to document where it
| > breaks.
| >
| >
|
|

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация