Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/02/2003, 02:49
Avatar de flavia
flavia
 
Fecha de Ingreso: noviembre-2002
Mensajes: 269
Antigüedad: 21 años, 5 meses
Puntos: 0
Ayuda!!!!!!!!.... puro codigo y .... lectura BD

Lamentablemente no trabajé nunca con BD en PHP... y no sé cómo hacerlo.
Tengo mi BD en Access y quisiera saber si es posible hacer una conexión a Access desde PHP. Si debo utilizar MySQL, cómo hago para pasar la BD?? Y cómo la actualizo luego?
No sé cómo realizar este pedazo de código por ejemplo: (esta en ASP)


<%
dim tev
tev=Request.QueryString("tipo")
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

dim cx
Set cx = Server.CreateObject("ADODB.Connection")
cx.Open "ATenis","",""

'************************************************* *******************************************
' obtengo todos
dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * from Evento WHERE (Tipo LIKE '" & tev & "')Order by Fecha DESC",cx

'************************************************* *******************************************
%>

<table width="74%" border="0" cellspacing="0">
<tr>
<td bgcolor="#000000" colspan="5"><img src="FOTOS/GRAFICA/eventi.gif" width="233" height="39"></td>
</tr>
<% if (rs.eof and rs.bof) then %>
<tr bgcolor="#FFFFFF">
<td align="center" colspan="15"> </td>
</tr>
<% else %>
<tr>
<td bgcolor="#FEECC0" colspan="5"> </td>
</tr>
<tr bgcolor="#FF9900">
<td colspan="5" bgcolor="#FEECC0">&nbsp;</td>
</tr>
<% do while not rs.eof %> <%

eve = rs("IdEvento")
%> <%
dim foto
dim pat
foto=rs("Foto")
quefoto = "Fotos/Eventi/" & foto & ".jpg"

pat=server.mappath("/Fotos/Eventi/")
foto= pat & "/" & foto & ".jpg"

dim service %>
<tr bgcolor="#333366">
<td width="93"><font color="#FFFFFF"><b></b></font></td>
<td width="93"><font color="#FFFFFF"><b><%=rs("Fecha")%></b></font></td>
<td width="2091" colspan="3"><font color="#FFFFFF"><b><%=rs("Titulo")%></b></font></td>
</tr>
<tr bgcolor="#FEECC0">
<td rowspan="5" width="93">&nbsp;</td>
<td rowspan="5" width="93">
<div align="right"><font size="2"><%If rs("Foto") <> "" Then%> <b> <image src="<%=quefoto%>" border="1" align="derecha"></b></font>
<font size="2"></font> <font size="2"></font><font size="2"></font>
<font size="2"><%else%> <b> <image src="Fotos/NoFoto.jpg" width="32" height="32" border="1"></b></font><font size="2"></font>
<font size="2"></font><font size="2"></font><font size="2"> </font><font size="2">
</font> <font size="2"><%End If%></font></div>
</td>
<td height="24" width="2091" colspan="3">
<blockquote>
<p><b><%=rs("Subtitulo")%></b></p>
</blockquote>
</td>
</tr>
<tr bgcolor="#FEECC0">
<td height="2" width="2091" colspan="3" >
<blockquote>
<p><%=rs("Texto")%></p>
</blockquote>
</td>
</tr>
<%
dim sql2
sql = "SELECT * from FotosxEvento WHERE (IdEvento LIKE '" & eve & "')"
' obtengo todas las fotos de un evento
dim rs2
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.open sql,cx
'<a href="Fotos.asp?evento=" & '"& eve &"' & "&titulo=" & '"& rs("Titulo")&"' & "&fecha=" & '"& rs("Fecha") &"'& "'&"'&"">fotos</a></p>
%>
<tr bgcolor="#FEECC0" colspan="3">
<td height="2" width="2091" colspan="3">
<p><%If not rs2.eof then %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Fotos.asp?evento=<%=eve%>&titulo=<%=rs("Titu lo")%>&fecha=<%=rs("Fecha")%>">Fotos</a><%ELSE%>
&nbsp; <% end if %> </p>
</td>
</tr>
<tr bgcolor="#FEECC0" colspan="3">
<td height="2" width="2091" colspan="3"><%If rs("Link") <> "" Then%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<%=rs("Link")%>"><font size="2"><%=rs("Link")%></font></a>
<%else%>&nbsp; <%End If%> </td>
</tr>
<tr bgcolor="#FEECC0" colspan="3">
<td height="2" width="2091" colspan="3"><%If rs("Link2") <> "" Then%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<%=rs("Link2")%>"><font size="2"><%=rs("Link2")%></font></a>
<%else%>&nbsp; <%End If%> <br>
</td>
</tr>
<% rs.movenext %> <% loop %> <% end if %>
</table>


POR FAVOR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!
GRACIAS!
__________________
Flavia.