Expand|Select|Wrap|Line Numbers
- <?php
- $link = mysqli_connect('localhost', 'myuser', 'mypass', 'database')
- or die ('Error connecting to mysql: ' . mysqli_error($link));
- $mires=0;
- $result = mysqli_query($link, "select addtable('r',$mires)");
- while ($row = mysqli_fetch_assoc($result))
- {
- $myoutput= $row['myvalue'];
- echo $myoutput;
- }
- ?>
Expand|Select|Wrap|Line Numbers
- CREATE TABLE `mytable` (
- `idta` INTEGER(11) NOT NULL AUTO_INCREMENT,
- `nom` VARCHAR(20) COLLATE latin1_swedish_ci DEFAULT NULL,
- PRIMARY KEY (`idta`)
- )ENGINE=InnoDB
- AUTO_INCREMENT=15 CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
Expand|Select|Wrap|Line Numbers
- BEGIN
- DECLARE xid integer;
- INSERT INTO mytable ( nom)
- SELECT pin AS Expr1;
- set xid=LAST_INSERT_ID();
- return myvalue;
- END
update:
I made a mistake, I put
$result = mysqli_query($link, "select addtable('r',$mires)");
instead of
$result = mysqli_query($link, "select addtable('r')");
but this was not my problem, that is, I am still in trouble with this.