Ir para conteúdo
Fórum Script Brasil

ivofb

Membros
  • Total de itens

    5
  • Registro em

  • Última visita

Sobre ivofb

ivofb's Achievements

0

Reputação

  1. Olá amigos! Sou novato na área de programação e li e re-li vários tópicos sobre o assunto mais quando apliquei deu erro. Estou tentando converter de mysql para mysqli e não está dando certo. abaixo posto o código para quem sabe vocês aqui possam me ajudar. ERRO GERADO: Fatal error: Call to undefined method mysqli_result::fetch() in C:\wamp\www\gesaojose2015\aniversarios-do-mes.php on line 40 <?PHP $mes = date("m"); $dia = date("d"); require '/conex.php'; // Conecta-se ao banco de dados MySQL $mysqli = new mysqli($servidor, $usuario, $senha, $banco); // Caso algo tenha dado errado, exibe uma mensagem de erro if (mysqli_connect_errno()) { trigger_error(mysqli_connect_error()); } //#SQL lista aniversariantes do mes $sql = "SELECT nome, funcao, DAY(nascimento) FROM niver WHERE MONTH(nascimento) ='$mes' ORDER BY DAY(nascimento) ASC"; $resultado = $mysqli->query($sql); while ($row = $resultado->fetch (PDO::FETCH_BOTH)) { echo "<table width=\"200\" border=\"0\">"; echo "<tr>"; echo "<th>DIA</th>"; echo "<th>NOME</th>"; echo "<th>SEÇÃO</th>"; echo "</tr>"; echo "<tr>"; echo "<center>"; echo "<td>".$row[2]."</td>"; echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "</center>"; echo "</tr>"; } echo "</table>"; ?> Desde já agradeço a atenção.
  2. Valeu BARETA. Você é o cara. Obrigado.
  3. Boa Noite ! Estou utilizando o seguinte script: <% function toLongMonth(pInInteger) mMonth = "Não encontrado" if isNumeric(pInInteger) then select case pInInteger case 01: mMonth = "Janeiro" case 02: mMonth = "Fevereiro" case 03: mMonth = "Março" case 04: mMonth = "Abril" case 05: mMonth = "Maio" case 06: mMonth = "Junho" case 07: mMonth = "Julho" case 08: mMonth = "Augosto" case 09: mMonth = "Setembro" case 10: mMonth = "Outubro" case 11: mMonth = "Novembro" case 12: mMonth = "Dezembro" end select end if toLongMonth = mMonth end function %> <table width="232" border="1"> <tr> <td width="222" style="text-align: center; font-size: 10px; font-weight: bold;" scope="col">ANIVERSARIANTES DO MÊS:<span style="color: #F00"> <% response.Write (toLongMonth(datepart("m", date())) + " / " + (datepart("yyyy", date())))%> E está dando o seguinte erro: Tipo de erro: Erro em tempo de execução do Microsoft VBScript(0x800A000D) Tipos Incompatíveis: '[string: "Abril / "]' Não sei mais o que fazer. Alguém pode me ajudar? Obrigado.
  4. :D Valeu mesmo BARETA. Você é o cara. Muito obrigado. São pessoas como você que fazem do mundo um lugar melhor.
  5. :rolleyes: Boa Noite Pessoal! Sou novato em ASP (totalmente) e consegui um script dos Aniv. do Mês, mas não está saindo como eu queria. Eu preciso que ele mostre todos os aniv. do mês e ele só me mostra os do dia. Alguém pode me ajudar? Obrigado. Segue o código completo abaixo: <% '********************************************************************************' '* This is a simple to install program - just place the Today.asp file anywhere *' '* on your site, and alter the global variables below to customize how it looks *' '********************************************************************************' mTitleColor = "DARKRED" '* This is the color of the title 'Today in History' *' mHeaderColor = "DARKBLUE" '* This is the color of the headers, Birthdays, Events *' mYearColor = "DARKBLUE" '* This is the color of the year *' mTextColor = "#069" '* This is the color of the text of the birthday or event *' mTitle = "Aniversariantes do Mês: " '* What you want to appear as the title *' mDataBaseDir = "Today.mdb" '*****************************************************' '* This is the location of the Today.mdb file in *' '* regards to your home directory - in this example *' '* it is the same directory as the Today.asp file *' '****************************************************' '* Function to return the verbose month given an integer 1-12 *' function toLongMonth(pInInteger) mMonth = "Não encontrado" if isNumeric(pInInteger) then select case pInInteger case 1: mMonth = "Janeiro" case 2: mMonth = "Fevereiro" case 3: mMonth = "Março" case 4: mMonth = "Abril" case 5: mMonth = "Maio" case 6: mMonth = "Junho" case 7: mMonth = "Julho" case 8: mMonth = "Augosto" case 9: mMonth = "Setembro" case 10: mMonth = "Outubro" case 11: mMonth = "Novembro" case 12: mMonth = "Dezembro" end select end if toLongMonth = mMonth end function '* Open DSNless connection to Today.mdb *' set connGlobal = server.createobject("ADODB.Connection") connGlobal.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= " & server.mappath(mDataBaseDir) '* SQL Statement to pull data *' mSQL = "SELECT his_type, his_day, his_desc FROM UNV_HISTORY " & _ " WHERE his_day = datepart('d', date()) " & _ " AND his_month = datepart('m', date()) " & _ " ORDER BY his_day, his_desc " '* Execute the SQL statement *' set rsGlobal = connGlobal.execute(mSQL) '* Display The Title *' response.write "<FONT COLOR = " & mTitleColor & " SIZE = '1'><B>" & mTitle & _ toLongMonth(datepart("m", date())) & _ " " & datepart("yyyy", date()) & _ "</b></FONT><BR><BR>" '* Display The Birthday Tag *' response.write "<FONT COLOR = " & mHeaderColor & "><B>Parabéns:</b></FONT>" mType = "B" '* Initialize a table that will be used to format results of rsGlobal *' response.write "<TABLE WIDTH = '100%'>" '* Loop through recordset *' while not rsGlobal.eof '* Check to see if the type has changed, if so change the Tag to Events: *' 'if rsGlobal("his_type") <> mType then ' mType = "E" ' response.write "</TABLE><BR><FONT COLOR = " & mHeaderColor & "><B>Events:</b></FONT>" ' response.write "<TABLE WIDTH = '100%'>" 'end if '* Display a single line from the result set *' response.write "<TR VALIGN = TOP><TD ALIGN = RIGHT WIDTH = '5%'><FONT COLOR = " & _ mYearColor & " SIZE = '-4'><B>&nbsp;&nbsp;" & rsGlobal("his_day") & "</b></font></td>" response.write "<TD WIDTH = '95%'><FONT COLOR = " & mTextColor & " SIZE = '-4'>" & rsGlobal("his_desc") & "</FONT></td></tr>" '* Move to the next record *' rsGlobal.movenext wend '* Close the table *' response.write "</TABLE>" '* Close the recordset and connection *' rsGlobal.close set rsGlobal = nothing connGlobal.close set connGlobal = nothing '* All Done *' %>
×
×
  • Criar Novo...