|
Posted by McHenry on 05/03/06 05:30
"robert" <ab@no.spam-alama-ding-dong> wrote in message
news:_vU5g.71$tD3.27@fe03.lga...
>| 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.
Correct, the simplified example is exactly the same scenario and exhibits
the same problems as the real example, if we can solve the simple one the
solution will carry over I'm sure.
>
> | 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. ;^)
Home of Porsche...
>
> |
> | >
> | > ===========
> | >
> | > <?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]
|