Search the Community
Showing results for tags 'mysql_result()'.
-
I'm trying to put some awkward codes into an array for processing, to get useful information from in the code, My problem is trying to get these codes from the database, can anyone Below is my code trying to get the codes from the database once it is outputting correctly I can then get on with the processing, any help getting an output I can then store into an array would be much appreciated! $query = "select * from orderlog where DeliverNote like '%$year%';"; $result = $db2->query($query); $num_results = $result->num_rows; $row = $result->fetch_assoc(); $i=1; while($i<=$num_results){ echo mysql_result($result,$i,"DeliverNote"); $i++; }
- 2 replies
-
- mysql_result()
- mysql
-
(and 3 more)
Tagged with:
-
I have only a little experience in interfacing PHP with MySQL, I'm trying to grab a single value from a database, specifically the name of an item stored with its details, in the following code I attempt to call the items name from the [Part_Name] column, for the given ID number in [PartID]. $query = "SELECT `Part_Name` FROM `".$list."` WHERE `PartID` = ".$partid.";"; $itemname = mysql_result(mysql_query($query), 0, 0); echo "<p>This will delete the item: "; echo $itemname; echo ". Are you sure you want to do this?</p>"; The resulting line says: [This will delete the item: . Are you sure you want to do this?]. ---------- Also, I tested that MySQL line and it output this: +-----------+ | Part_Name | +-----------+ | screen | +-----------+ if that helps at all, I've tried changing the row and field values in mysql_result() but haven't had any success, am I using it wrong? ---------- Can anyone point me in the right direction? Thanks
- 10 replies
-
- mysql
- single value
-
(and 2 more)
Tagged with: