Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Using databases with frontpage
Old 04-21-2005, 10:50 AM Using databases with frontpage
Junior Talker

Posts: 4
Trades: 0
Hi everybody... I´m a newcomer in websites database programming and I need to use a customer database in my website. The customer will log in using its user id and password, and the idea is to show another page with database results according to each customer. The server that has my website supports Frontpage extensions and php/my sql. The problem is that I don´t know which platform is the best (it´s a very simple database), and also don´t know how to make the entire process or where can I learn more. I have a basic knowledge on PHP and I used frontpage 2003 to build the website. Is Access the best solution? How can I upload the database?... Can anybody help me, please? Thank you very much...
Juanjo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-21-2005, 01:08 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
comparing FP extension to PHP/MySQL. No contest PHP any time.

you need to know what the host supports before considering what to use, you may have no choice,
is it a LAMP environment? (Linux, Apache, MySQL, PHP)
is it Windows server ASP + MS SQL, Access (heaven forbid) ,MySQL
any server-side scripting at all?
have you got any database facilities?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-25-2005, 07:22 PM
Junior Talker

Posts: 4
Trades: 0
Thank you very much for your help, Chris... I begin telling you that the host uses Windows OS and supports ASP/SQL/Frontpage extensions ( no PHP ). I´m using Access to create my database and I have tried to upload it with the Wizard that´s included in Frontpage, but I have lots of problems with the whole process. I have a very little experience with scripting languages and don´t know how to start. First, I´ve set up my database in access, then imported it to Frontpage ( this creates several pages like global.asa and form pages ). The problem is that those forms does not give me the things I need. Basically, the customer will input its user id and password. Then, I have to read the database, find the user id in the database and show some fields, that´s all. I´ve been looking all around Internet for a good Tutorial, but everyone I found seems to be made for a pro. Do you know a good tutorial for begginers that covers all about databases? Thank you again, Chris, and excuse me if I didn´t write you before....
Juanjo is offline
Reply With Quote
View Public Profile
 
Old 04-26-2005, 02:21 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
W3Schools Is a good place to start there are ASP and SQL tutorials.
DevGuru when you want to get seriously into code.

Database sample code, take a look at ASP101 some tutorials there as well and have a look at the FAQs and forums at Tek-Tips ASP and FP specific forums there.

Personally I don't trust any software to write code for me so I won't be much help on FP wiizards.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-27-2005, 06:50 PM
Junior Talker

Posts: 4
Trades: 0
Thank you again, Chris... You know, I´m going crazy with this. I´m going to visit the tutorial and code sites you told me. Hopefully, I'll find something there... By now, I have read 2 or 3 ASP tutorials and made the following code ( it took me about four hours to this lines, guaaa ):

<%
eusuari = Request.Form("usuari")
econtra = Request.Form("contrasena")

SQL = "SELECT * FROM Stros1"
SQL = SQL & "WHERE Cli=eusuari"
SQL = SQL & "AND Pol=econtra"

set conn = server.CreateObject("ADODB.Connection")
conn.open "Database1"
set client = conn.execute(SQL)


If client.bof and client.eof then
Response.Write("Your user ID and password are wrong. Try again")
Else
Response.Write("WELCOME: <B>" & usuari & "</B>")
Do while not client.eof
Response.Write("FECHA: <B>" & client("Fecha") & "</B>")
Response.Write("POLIZA: <B>" & client("Pol") & "</B>")
Response.Write("CLIENTE: <B>" & client("NCli") & "</B>")
Response.Write("NOTAS1: <B>" & client("Notas1") & "</B>")
Response.Write("NOTAS2: <B>" & client("Notas2") & "</B>")
Response.Write("------------------------------")
client.movenext
loop
End if


client.close
%>

But it´s not working... The page gives me an error that says the server did not find my table and a Microsoft Jet error. I have created my DSN and connection string but nothing... I don´t know what to do... I really appreciate your help and excuse me if I causing you problems with this topic. Well, right now I´m going to see the sites you gave me. See you, Chris...
Juanjo is offline
Reply With Quote
View Public Profile
 
Old 04-28-2005, 04:45 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you are missing some spaces here
Code:
SQL = "SELECT * FROM Stros1"
SQL = SQL & "WHERE Cli=eusuari"
SQL = SQL & "AND Pol=econtra"
it needs to be
Code:
SQL = "SELECT * FROM Stros1 "
SQL = SQL & "WHERE Cli=eusuari "
SQL = SQL & "AND Pol=econtra ;"
debug tip.
If you are having connection or DB errors ALWAYS ALWAYS response.write out your SQL statement after building it to make sure it's what you expect it to be.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-30-2005, 02:01 AM
Junior Talker

Posts: 4
Trades: 0
Hello Chris, I've got good news for you... MY DATABASE IS WORKING !!! Thank you so much for your help. I read the w3schools tutorials ( it´s a great site ) and follow your advice and, finally, my database is working. Here´s the final code...

<%
'Obtener variables del formulario de login
eusuari = Request.Form("usuari")
econtra = Request.Form("contrasena")

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/fpdb/empresa.mdb"))
set client = Server.CreateObject("ADODB.recordset")
client.Open "Select * from Stros1 WHERE NCli = '" & eusuari & "' AND Cli = '" & econtra & "'", conn

'Verificar si es usuario autorizado y mostrar datos
If client.bof and client.eof then
Response.Write("<P Align=""center""><font face=""Verdana"" size=""2"">El nombre de usuario y la contraseña no existen:" & "</font></P>")
Response.Write("<P Align=""center""><font face=""Verdana"" size=""2"">Usted no está registrado como cliente o escribió mal sus datos." & "</font></P>")
Response.Write("<P Align=""center""><font face=""Verdana"" size=""2"">Por favor, vuelva a la sección de clientes e intente de nuevo." & "</font></P>")
Else
Response.Write("<P><font face=""Verdana"" size=""2""><B>BIENVENIDO AL AREA DE CLIENTES: </B>" & eusuari & "</font></P>")
Response.Write("<P><font face=""Verdana"" size=""2"">Su reporte de seguimiento para siniestros: " & "</font></P>")
Do while not client.eof
Response.Write("<P><font face=""Verdana"" size=""2""><B>FECHA: </B>" & client("Fecha") & "</font></P>")
Response.Write("<P><font face=""Verdana"" size=""2""><B>POLIZA: </B>" & client("Pol") & "</font></P>")
Response.Write("<P><font face=""Verdana"" size=""2""><B>NOTAS1: </B>" & client("Notas1") & "</font></P>")
Response.Write("<P><font face=""Verdana"" size=""2""><B>NOTAS2: </B>" & client("Notas2") & "</font></P>")
Response.Write("<P><HR></P>")
client.movenext
loop
End if

'Cerrar la conexión
client.close
conn.close
%>

You helped me a lot to achieve this, your a great and nice person, Chris.
THANK YOU AGAIN, A LOT...
Juanjo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Using databases with frontpage
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54503 seconds with 12 queries