TheGoodVibe
Programmer
Ok, so I have this connection as a .php file:
then I try to use it on my main file:
But as far as its going, it only echoes that first line on my main program and nothing else. Im kid of new to PHP so i can't figure out whats wrong with it
Code:
<?php
echo ("Currently connecting to DB");
//Connect to DB
$conn=odbc_connect('wordgame.accdb','','') || die ( "Error Connecting to the database");
//List of all words
$sql1 = "SELECT * FROM words";
$rs1= odbc=exec($conn,$sql1);
//List of all non-allowed words
$sql2 = "SELECT * FROM cursewords";
$rs2= odbc=exec($conn,$sql2);
//List of all Possible words to be added
$sql3 = "SELECT * FROM tblpossibleWords";
$rs3= odbc=exec($conn,$sql3);
?>
then I try to use it on my main file:
Code:
<?php
echo "starting program";
require ("dbconn.php");
$status = dbconn.php;
$mainWord = odbc_result($rs1,rand(0,odbc_num_rows($rs1)));
$scrambled = str_shuffle($mainWord);
echo ("There are currently ". odbc_num_rows($rs1). " Words in the game\n");
?>
But as far as its going, it only echoes that first line on my main program and nothing else. Im kid of new to PHP so i can't figure out whats wrong with it