Jump to content

CanMike

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

CanMike's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The password() function is the minimum requirement to encrypt data. You can use MD5() of SHA1(), depending upon the depth of encryption you require. This is why designing and building a database can be a lot more complicated than you think. As I stated in my response, this is just a suggestion has to how you could add a table to a database, populate the fields and then access the data. You'll have to talk to your client to get a clear understanding as to how 'encrypted' the data must be. I use the password() function on all my applications without any problems to date. I've used SHA1 on v4 MySQL and had a problem with the function when I upgraded to v5 MySQL. It was a problem with the initial length of the field in the column definition.
  2. Be careful with the "SELECT * from table_name". Although convenient, a SELECT statement like on a table without an index uses a ton of resources. Imagine a database with 100,000 or over a million rows of data and your asking the database engine to parse every row. My guess would be that your client would not be too happy with the delay in response time. Try to limit you select to columns you intend to operate on and better yet, select columns that are index or a ORDER BY clause on a index column. I know that this may not be possible all the time, but ask the database administrator for a copy of the database schema (sorry it's my Oracle DBA background that keeps creeping into my MySQL explanations). Do this and you'll look like a superstar to your client. Mike, Toronto, Canada
  3. Designing databases is a job by itself! Minimum requirement would be a one table with three columns: client_id, username and password. create table client( client_id int(10), username tinytext not null, userpass varchar(50) ); When inserting you could use the syntax: INSERT INTO client VALUES (<client number>, '<username>', PASSWORD('<password>'); When confirming the user you could use the syntax: SELECT username FROM client WHERE client_id = <input id value> AND userpass = password(<'password supplied'>); With what little information you have supplied, there is no way to really help you out. These are just suggestions. If you need a database designed and constructed you may consider a third party vendor. A badly built database will kill you in the long run. I know, I built Oracle and MySQL database for a living.
  4. You've got a problem with the structure of your SQL: try this: SELECT * from TRANSACTION WHERE type = 'Bill' AND userid = '" . $SESSION['cymember']. "' ORDER BY submitted DESC LIMIT 1; Note that the WHERE clause must precede the ORDER BY I tested this against a library database and it returned exactly what I wanted. Hope this was helpful. Mike, Toronto, Canada
  5. Help, I've upgraded to MySQL 5 & PHP 5 so that I can use stored procedures. I've successfully and tested (from the mysql command line) a compile a stored procedure add_stuff.sql delimiter ~ create procedure add_stuff( IN inC1 text) BEGIN INSERT INTO t1 (c1) VALUES (inC1); END ~ delimiter ; So I wrote some PHP to test the call: <?php # add_stuff.php $conn = @mysqli_connect('localhost', 'miketest', 'mike', 'test1'); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $c1 = 'mike'; $result = @mysqli_query ($conn, 'call add_stuff($c1)'); if (mysqli_affected_rows($conn) == 1) { printf("Success"); } else { printf("Errormessage Details: %s\n", mysqli_error($conn)); } mysqli_close($conn); ?> As you can see, I have not enclosed the variable $c1 in either single or double quotes in this version. When I run this code I get this error: Errormessage Details: Unknown column '$c1' in 'field list' So then I changed the call to 'call add_stuff('.$c1.') and I get the error: Errormessage Details: Unknown column 'mike' in 'field list' I've been working with Oracle stored procedures for years, so I quite comfortable with the structure, but I'm lost when it comes to CALLING the SP from PHP. What am I doing wrong? How do I pass an argument within a call statement? Thanks
  6. Just goto www.oracle.com.  On the lefthand side under TECHNOLOGY PRODUCTS, click on downloads.  Click on Oracle 10G and follow the download instructions.  FREE. I've been working with Oracle since the 1990's and have always downloaded the most recent version here. You have to agree not to use it for a commerical enterprise. I run Oracle on my Windows XP Pro  and my Linix Redhat Enterprise version 4.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.