creating a data grid

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
johnjalani
Forum Newbie
Posts: 6
Joined: Tue Apr 01, 2008 5:45 am

creating a data grid

Post by johnjalani »

hi please help me, i am a student and our prof. is not good in teaching us PHP, so we always end up asking in forums like this,

i would need to create a data grid from mysql table, or i would say a data table from mysql database with CRUD (i don't know if the word CRUD is ryt, but what i mean is capable of updating, deleting, adding and inserting data directly in the data table) options, also ofcouse how to connect to my tables from mysql?


please help me, thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: creating a data grid

Post by Christopher »

Have you searched for "CRUD". There are many examples around.
(#10850)
johnjalani
Forum Newbie
Posts: 6
Joined: Tue Apr 01, 2008 5:45 am

Re: creating a data grid

Post by johnjalani »

i tried to search for the word "CRUD" or "create CRUD" but i don't see any thing helpul,please help me,

all i need is this, i have a form, then when i press the submit button, all the information encoded from the form will be added (insert) to mysql db, and after adding the information, it will send an email using php's mail() function

this is my code:

Code: Select all

 
<?php
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$emailAdd = $_POST['emailAdd'];
$address = $_POST['address'];
$tel = $_POST['tel'];
$order = $_POST['order'];
$remarks = $_POST['remarks'];
$all = $_REQUEST['ok'];
 
 
$conn = mysqli_connect('localhost','root','sa','gnsolutions');
$query = "INSERT INTO buyer (firstName, lastName, emailAdd, address, tel, order, remarks) VALUES ('$firstName', '$lastName','$emailAdd','$address','$tel','$order'.'$remarks')";
mysql_query($query) or die('Error, insert query failed1');
 
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed2');
 
print 'sending Email.....';
$to = 'myemail@gmail.com';
$from = 'From: adik@ikae.com';
$subject = 'testing';
$message = 'Order Request by:'. $_POST['firstName'].' '. $_POST['lastName'] . "\n" . $_POST['order']
             . 'orders of' . 'headset 1' . "\n";
 
mail($to,$subject,$message,$from);
 
#header('location: home.php');
 
?>
 
i already edited the php.ini

Code: Select all

 
[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 25
 
; For Win32 only.
sendmail_from = myemail@gmail.com
 
so before all of this i have a form from my form.php

Code: Select all

 
<form style="position:absolute; left: 226px; top: 141px; width: 284px;" method="post" action="process.php">
<table width="324" border="1">
  <tr>
    <td>First Name:</td>
    <td><input type="text" name="firstName" /></td>
  </tr>
 
.....................
.......................
...................
 
 <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value=" Accept" name="ok" /></td>
  </tr>
</table>
 
</form>
 
 
Please help me,
still it does not insert the information to mysql db and also does not send a the mail?

Thanks.,
SALAMAT PO.,
Post Reply