Jump to content


Photo

Where can i learn Mysqli


  • Please log in to reply
12 replies to this topic

#1 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 06 August 2006 - 06:11 PM

please point me in some directions thank you.
Dont Piss me Off today

#2 hostfreak

hostfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 581 posts

Posted 06 August 2006 - 06:18 PM

mySQL ? http://dev.mysql.com.../refman/5.0/en/

#3 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,430 posts
  • LocationBelgium

Posted 06 August 2006 - 06:19 PM

One: how did you manage to fill in the register form of this website?
Two: who allowed you?
Three: ever heard of google?
Four: manuals ever heard of?
Five: here is your damn tutorial/manual http://devzone.zend....ode/view/id/686

It is always nice to see, people doing some effort to get something...

#4 hostfreak

hostfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 581 posts

Posted 06 August 2006 - 06:20 PM

Didn't even know there was Mysqli o_O

#5 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,430 posts
  • LocationBelgium

Posted 06 August 2006 - 06:21 PM

yeah is some sort of an extension... mysqli (MySQL Improved) never used it though, maybe some day...

#6 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 06 August 2006 - 06:24 PM

Looking for more of a manual not a tutorial

can i ask a question mysqli is way different then regular MySQL and yes i heard of google

mysql

<?
$uname ="Uname";//Username
$upass ="upass";//Userpassword
$database="dbname";//Database name
mysql_connect("localhost",$uname,$upass);
mysql_select_db($database) or die(mysql_error());
?>

mysqli
<?php

/* Connect to a MySQL server */
$link = mysqli_connect(
            'localhost',  /* The host to connect to */
            'user',       /* The user to connect as */
            'password',   /* The password to use */
            'world');     /* The default database to query */

if (!$link) {
   printf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error());
   exit;
} 
?>

Dont Piss me Off today

#7 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 06 August 2006 - 06:35 PM

thanks benjamin for your support im learning all this so i can open up my PHP site soon and mysqli is just a weekpoint of my coding abilities.

Anybody got a quick referrence couldnt find anything on google.
Dont Piss me Off today

#8 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,430 posts
  • LocationBelgium

Posted 06 August 2006 - 06:37 PM

hearing of it is not enough, its using it that defines you...
look, i'm not trying to insult you or anything, but "where can you learn mysqli?" on php.net or read a book, want help with something involving mysqli (a function not working, strange error's, etc...), that's what we are here for, we're not gonna play your teacher..

@scheols if you know mysql, you will be easily picking up with mysqli, because the changes aren't that big... you still connect with your database through mysqli_connect(); the only difference is that mysql_select_db() is left out and an i has been added to the connect function! You also have the ability to directly put your database name in your connect function

here a direct link to it: http://php.belnet.be...qli-connect.php i will post a tutorial/manual later on to explain its use

#9 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 06 August 2006 - 06:45 PM

hearing of it is not enough, its using it that defines you...
look, i'm not trying to insult you or anything, but "where can you learn mysqli?" on php.net or read a book, want help with something involving mysqli (a function not working, strange error's, etc...), that's what we are here for, we're not gonna play your teacher..

@scheols if you know mysql, you will be easily picking up with mysqli, because the changes aren't that big... you still connect with your database through mysqli_connect(); the only difference is that mysql_select_db() is left out and an i has been added to the connect function! You also have the ability to directly put your database name in your connect function

its more then just mysqli_connect kid now if you dont want 2 help fine with me leave this thread as i said i know mysql i want to know more about mysqli do u understand? its a help forum, now im looking forsomeone who can tell me where i can learn this mysqli functions etc..  please stop posting.
Dont Piss me Off today

#10 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 06 August 2006 - 06:54 PM

Has this forum suddenly turned into somewhere for people to slag each other off?

Anyways, scheols, without further irritating anyone, from what you have said, ignace is right; the manual has to be the best place to start. You just said you are looking to learn about mysqli functions, and the manual gives details about all of them. The menu on this page:
http://uk.php.net/mysqli_connect
Has all of the functions. Why not try looking at them and if there are specific functions you need help with, then ask away.

#11 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,430 posts
  • LocationBelgium

Posted 06 August 2006 - 06:55 PM

Now, what you originally requested..

first of all mysqli can be used like you have always used mysql or in oop style

"Normal" mode:
<?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");
 
/* Prepare an insert statement */
$query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)";
$stmt = mysqli_prepare($link, $query);

mysqli_stmt_bind_param($stmt, "sss", $val1, $val2, $val3);

$val1 = 'Stuttgart';
$val2 = 'DEU';
$val3 = 'Baden-Wuerttemberg';
   
/* Execute the statement */
mysqli_stmt_execute($stmt);

$val1 = 'Bordeaux';
$val2 = 'FRA';
$val3 = 'Aquitaine';
   
/* Execute the statement */
mysqli_stmt_execute($stmt);

/* close statement */
mysqli_stmt_close($stmt);

/* retrieve all rows from myCity */
$query = "SELECT Name, CountryCode, District FROM myCity";
if ($result = mysqli_query($link, $query)) {
   while ($row = mysqli_fetch_row($result)) {
       printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]);
   }
   /* free result set */
   mysqli_free_result($result);
}

/* remove table */
mysqli_query($link, "DROP TABLE myCity");

/* close connection */    
mysqli_close($link); 
?> 

Using Object Oriented Style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
   
/* check connection */
if (mysqli_connect_errno()) {
   printf("Connect failed: %s\n", mysqli_connect_error());
   exit();
}
   
$mysqli->query("CREATE TABLE myCity LIKE City");
 
/* Prepare an insert statement */
$query = "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)";
$stmt = $mysqli->prepare($query);

$stmt->bind_param("sss", $val1, $val2, $val3);

$val1 = 'Stuttgart';
$val2 = 'DEU';
$val3 = 'Baden-Wuerttemberg';
   
/* Execute the statement */
$stmt->execute();

$val1 = 'Bordeaux';
$val2 = 'FRA';
$val3 = 'Aquitaine';
   
/* Execute the statement */
$stmt->execute();

/* close statement */
$stmt->close();

/* retrieve all rows from myCity */
$query = "SELECT Name, CountryCode, District FROM myCity";
if ($result = $mysqli->query($query)) {
   while ($row = $result->fetch_row()) {
       printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]);
   }
   /* free result set */
   $result->close();
}

/* remove table */
$mysqli->query("DROP TABLE myCity");

/* close connection */    
$mysqli->close(); 
?> 

if there is something you don't understand, then i'll probably will be hearing from you...

#12 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 06 August 2006 - 07:26 PM

If there is anymore swearing/slagging each other off in this thread again this thread will be closed. I have gone through and removed much of the swearing from this thread, please keep in mind there is possibly minors browsing this forum.

Also ignace if you dont like people asking these types of questions then don't bother replying.


#13 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 06 August 2006 - 07:48 PM

close it i dont care no more im out im tired of these type of people.
Dont Piss me Off today




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users